From d1910c9a68ebcbb133943806cb4ab77ffe9be97d Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Thu, 19 Dec 2024 17:58:39 +0000 Subject: [PATCH] feat : adds IntegrationTest for JobInvoker --- batch-boot-jpa-sample/pom.xml | 2 +- .../controllers/JobInvokerControllerIT.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/JobInvokerControllerIT.java diff --git a/batch-boot-jpa-sample/pom.xml b/batch-boot-jpa-sample/pom.xml index 1f7bb3eae..61ec4c20a 100644 --- a/batch-boot-jpa-sample/pom.xml +++ b/batch-boot-jpa-sample/pom.xml @@ -243,7 +243,7 @@ - 1.25.0 + 1.25.2 diff --git a/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/JobInvokerControllerIT.java b/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/JobInvokerControllerIT.java new file mode 100644 index 000000000..d781cd82c --- /dev/null +++ b/batch-boot-jpa-sample/src/test/java/com/example/bootbatchjpa/web/controllers/JobInvokerControllerIT.java @@ -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"))); + } +}