From 533647717ac56f6e1ba967f24b79bf868104f32d Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Thu, 10 Nov 2022 17:22:24 +0800 Subject: [PATCH] test: add REST API test for get claim status --- .../komga/interfaces/api/rest/ClaimControllerTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ClaimControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ClaimControllerTest.kt index 81e37ba3..bb1326c4 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ClaimControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ClaimControllerTest.kt @@ -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() } + } + } }