This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://start.spring.io/starter.zip \ | |
-d dependencies=web,actuator,data-jpa,h2 \ | |
-d javaVersion=21 \ | |
-d name=spring-boot-testing-primer \ | |
-d artifactId=spring-boot-testing-primer \ | |
-d groupId=de.rieckpil.blog \ | |
-d packageName=de.rieckpil.blog \ | |
-d type=maven-project \ | |
-o spring-boot-testing-primer.zip | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-test</artifactId> | |
<scope>test</scope> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Testcontainers | |
class SpringBootIT { | |
@Container | |
static PostgreSQLContainer<?> postgreSQLContainer = | |
new PostgreSQLContainer<>(DockerImageName.parse("postgres:13")) | |
.withPassword("inmemory") | |
.withUsername("inmemory"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.codeborne</groupId> | |
<artifactId>selenide</artifactId> | |
<version>5.22.0</version> | |
<scope>test</scope> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mockMvcGet | |
org.springframework.test.web.servlet.MvcResult result = this.mockMvc | |
.perform(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get($url$) | |
.header(org.springframework.http.HttpHeaders.ACCEPT, org.springframework.http.MediaType.APPLICATION_JSON)) | |
.andExpect(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status().is(200)) | |
.andExpect(org.springframework.test.web.servlet.result.MockMvcResultMatchers.content().contentType(org.springframework.http.MediaType.APPLICATION_JSON)) | |
.andExpect(org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath("$.size()", org.hamcrest.Matchers.is(0))) | |
.andDo(org.springframework.test.web.servlet.result.MockMvcResultHandlers.print()) | |
.andReturn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIwL4flKehVqPOueQDOj6dRUemxX5k79foJ+excRW0uPCSlLrqQEfSbpdiXc+CMVdU0qUahsYu93aWM14WCVbNq/9naM1fEP8/Wow+5pHGq4CJqur9gDXQG5pHQgEMFHJOZl9ljBP/k1HNnODXvXirnJfsREjQPNt06K0wYaD8EASdt+k0RQtaX5YVtWAxmr48tGrx67GEXQIYtC1XYQ61odXueLKRDYVwwC8Obe+0AFWzoSNQ/6PtD8ClTBWF23V+9UeydgBGQqpSANgIxkRxTShX3783Uuq6EfQGCi52YtNezS33zZO4mEVd4C7rn3wXAKhtdSZDoO5oq3mbzbqgTZJL3LG5/BYrpoGVgWwnwGvdoTuJ4pnJbix1pAU1xvtzX1F287Stx8ntim7yw5r+lMFpwsEjBSpAvZAA+4iqnChJuxs0vY1ouDDdVJ6x5YhyXM6jEfVkUlZ0lk/TWv0pRmWtvSXJZ+O/7bMsiZ3f44MKe/6apaXBN7rMgN8hY31Iwx9ypLBNlbQPRrT6ML7GWxfi1sQ3sScVUMvuH16FpBjEAWsqiUQipneC/SGqxRfZnGqlPcwBgX9Xj9B84+h920Z+BwS488R0Dc2Bw3MYsJP/AaenpA7UE1Sju1/Vc7C1ANuPyiRfjWavEW8XZm8qyvEbVbf8i09FOAKJ7FXOew== mail@philipriecks.de |
OlderNewer