-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding integration test support with Test container for MySQL
- Loading branch information
Sourav Roy
authored and
Sourav Roy
committed
Jan 9, 2024
1 parent
eaeb2b9
commit f1a15e5
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
src/test/java/com/homihq/db2rest/rest/MySQLReadControllerTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.homihq.db2rest.rest; | ||
|
||
import com.homihq.db2rest.MySQLBaseIntegrationTest; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.http.MediaType; | ||
|
||
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; | ||
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
class MySQLReadControllerTest extends MySQLBaseIntegrationTest { | ||
@Test | ||
@DisplayName("Get all fields.") | ||
void findAllFilms() throws Exception { | ||
|
||
mockMvc.perform(get("/films") | ||
.accept(MediaType.APPLICATION_JSON)) | ||
.andExpect(status().isBadRequest()) | ||
.andDo(document("get-all-films")); | ||
} | ||
} |
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