Skip to content

Commit

Permalink
バッチAPを正常起動できるように修正 (#1287)
Browse files Browse the repository at this point in the history
  • Loading branch information
TakashiOhkubo authored Oct 9, 2024
1 parent 3c62508 commit 52d1c2a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.mybatis.spring.batch.MyBatisPagingItemReader;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.batch.core.repository.JobRepository;
Expand All @@ -27,7 +26,6 @@
@Configuration
@ComponentScan(basePackages = { "com.dressca" })
@MapperScan(basePackages = { "com.dressca.infrastructure.repository.mybatis" })
@EnableBatchProcessing
public class BatchConfiguration {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.web-allow-others=true
spring.sql.init.mode=embedded
mybatis.configuration.map-underscore-to-camel-case=true
mybatis.configuration.map-underscore-to-camel-case=true
spring.batch.job.name=catalogItem_tasklet_job
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ spring.h2.console.path=/h2-console
spring.h2.console.settings.web-allow-others=true
spring.sql.init.mode=embedded
mybatis.configuration.map-underscore-to-camel-case=true
spring.batch.job.name=catalogItem_tasklet_job
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import org.junit.jupiter.api.TestInstance;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.test.JobLauncherTestUtils;
import org.springframework.batch.test.context.SpringBatchTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.FileSystemResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
Expand All @@ -27,6 +27,7 @@
/**
* CatalogItemJobのテストです。
*/
@SpringBootTest
@SpringBatchTest
@SpringJUnitConfig(BatchConfiguration.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
Expand All @@ -38,8 +39,6 @@ public class CatalogItemJobTest {
@Qualifier("catalogItem_job")
Job catalogItemJob;
@Autowired
JobLauncher jobLauncher;
@Autowired
JobRepository jobRepository;
private JdbcTemplate jdbcTemplate;
private static final String OUTPUT_FILE = "output/outputData.csv";
Expand Down

0 comments on commit 52d1c2a

Please sign in to comment.