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

OZG-4717 Added WitchMockUser

parent 18ad3b4f
Branches
Tags
No related merge requests found
...@@ -90,6 +90,10 @@ ...@@ -90,6 +90,10 @@
<groupId>org.testcontainers</groupId> <groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency><dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<profiles> <profiles>
......
...@@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test; ...@@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestProperties; import org.springframework.boot.autoconfigure.data.rest.RepositoryRestProperties;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.ResultActions;
...@@ -38,6 +39,7 @@ import lombok.SneakyThrows; ...@@ -38,6 +39,7 @@ import lombok.SneakyThrows;
@ITCase @ITCase
@AutoConfigureMockMvc @AutoConfigureMockMvc
@WithMockUser
class ApiRootITCase { class ApiRootITCase {
@Autowired @Autowired
......
...@@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestProperties ...@@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestProperties
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.ResultActions;
...@@ -40,6 +41,7 @@ import lombok.SneakyThrows; ...@@ -40,6 +41,7 @@ import lombok.SneakyThrows;
@DataITCase @DataITCase
@AutoConfigureMockMvc @AutoConfigureMockMvc
@WithMockUser
class ConfigurationParameterITCase { class ConfigurationParameterITCase {
@Autowired @Autowired
......
...@@ -7,6 +7,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. ...@@ -7,6 +7,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import de.ozgcloud.common.test.DataITCase; import de.ozgcloud.common.test.DataITCase;
...@@ -14,6 +15,7 @@ import lombok.SneakyThrows; ...@@ -14,6 +15,7 @@ import lombok.SneakyThrows;
@DataITCase @DataITCase
@AutoConfigureMockMvc @AutoConfigureMockMvc
@WithMockUser
class AdminEnvironmentITCase { class AdminEnvironmentITCase {
@Autowired @Autowired
private MockMvc mockMvc; private MockMvc mockMvc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment