test: add REST API test for get claim status

This commit is contained in:
Gauthier Roebroeck 2022-11-10 17:22:24 +08:00
parent 35be71ed74
commit 533647717a

View file

@ -1,14 +1,17 @@
package org.gotson.komga.interfaces.api.rest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.security.test.context.support.WithAnonymousUser
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.get
import org.springframework.test.web.servlet.post
@ExtendWith(SpringExtension::class)
@ -31,4 +34,13 @@ class ClaimControllerTest(
status { isBadRequest() }
}
}
@Test
@WithAnonymousUser
fun `given anonymous user when getting claim status then returns OK`() {
mockMvc.get("/api/v1/claim")
.andExpect {
status { isOk() }
}
}
}