-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : adds IntegrationTest for JobInvoker
- Loading branch information
1 parent
f193822
commit d1910c9
Showing
2 changed files
with
20 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
...sample/src/test/java/com/example/bootbatchjpa/web/controllers/JobInvokerControllerIT.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,19 @@ | ||
package com.example.bootbatchjpa.web.controllers; | ||
|
||
import static org.hamcrest.Matchers.containsString; | ||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
import com.example.bootbatchjpa.common.AbstractIntegrationTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class JobInvokerControllerIT extends AbstractIntegrationTest { | ||
|
||
@Test | ||
void shouldInvokeAllCustomersJob() throws Exception { | ||
mockMvc.perform(get("/api/job/customers").param("minId", "0").param("maxId", "100")) | ||
.andExpect(status().isOk()) | ||
.andExpect(content().string(containsString("Batch job has been invoked as"))); | ||
} | ||
} |