-
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 (#1585)
* feat : adds IntegrationTest for JobInvoker * adds more tests
- Loading branch information
1 parent
8bb92f8
commit 4e35643
Showing
4 changed files
with
35 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
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
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
30 changes: 30 additions & 0 deletions
30
...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,30 @@ | ||
package com.example.bootbatchjpa.web.controllers; | ||
|
||
import com.example.bootbatchjpa.common.AbstractIntegrationTest; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.http.HttpStatus; | ||
|
||
class JobInvokerControllerIT extends AbstractIntegrationTest { | ||
|
||
@Test | ||
void shouldInvokeAllCustomersJob() { | ||
mockMvcTester | ||
.get() | ||
.uri("/api/job/customers") | ||
.param("minId", "0") | ||
.param("maxId", "100") | ||
.assertThat() | ||
.hasStatusOk() | ||
.hasContentType("text/plain;charset=UTF-8") | ||
.hasBodyTextEqualTo("Batch job has been invoked as 1"); | ||
} | ||
|
||
@Test | ||
void shouldReturnBadRequestForMissingParameters() { | ||
mockMvcTester | ||
.get() | ||
.uri("/api/job/customers") | ||
.assertThat() | ||
.hasStatus(HttpStatus.BAD_REQUEST); | ||
} | ||
} |