Skip to content
Snippets Groups Projects
Commit 157f4beb authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4939 Added test for WWW-Authenticate Header in 401 Error

parent a420dfdf
Branches
Tags
No related merge requests found
...@@ -27,6 +27,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. ...@@ -27,6 +27,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import java.net.URI; import java.net.URI;
import org.apache.http.HttpHeaders;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
...@@ -141,6 +142,14 @@ public class SecurityConfigurationLocalITCase { ...@@ -141,6 +142,14 @@ public class SecurityConfigurationLocalITCase {
objectMapper.setSerializationInclusion(Include.NON_NULL); objectMapper.setSerializationInclusion(Include.NON_NULL);
return objectMapper.writeValueAsString(problemDetail); return objectMapper.writeValueAsString(problemDetail);
} }
@Test
@SneakyThrows
void shouldHaveWWW_AUTHENTICATEHeader2() {
var result = doPerform("/api");
result.andExpect(header().string(HttpHeaders.WWW_AUTHENTICATE, "Bearer realm=\"Restricted Content\""));
}
} }
@SneakyThrows @SneakyThrows
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment