wip
This commit is contained in:
parent
35b1533db1
commit
48fcf8a39d
|
@ -17,13 +17,13 @@
|
|||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-core</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-server-empi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-test</artifactId>
|
||||
<artifactId>spring-batch-core</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -31,12 +31,18 @@
|
|||
<artifactId>spring-batch-infrastructure</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
<version>${spring_data_version}</version>
|
||||
</dependency>
|
||||
<!--test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-test</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>java-hamcrest</artifactId>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package ca.uhn.fhir.jpa.batch.config;
|
||||
|
||||
import ca.uhn.fhir.jpa.batch.svc.DummyService;
|
||||
import org.springframework.batch.core.configuration.annotation.BatchConfigurer;
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -11,12 +10,15 @@ import org.springframework.context.annotation.Configuration;
|
|||
@EnableBatchProcessing
|
||||
public class BatchConfig {
|
||||
|
||||
@Autowired
|
||||
private JobRepository myJobRepository;
|
||||
|
||||
@Bean
|
||||
public DummyService dummyService() {
|
||||
return new DummyService();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BatchConfigurer jpaBatchConfigurer() {
|
||||
return new JpaBatchConfigurer();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package ca.uhn.fhir.jpa.batch.config;
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
@Component
|
||||
public class JpaBatchConfigurer extends DefaultBatchConfigurer {
|
||||
|
||||
@Autowired
|
||||
private PlatformTransactionManager myPlatformTransactionManager;
|
||||
|
||||
@Override
|
||||
public PlatformTransactionManager getTransactionManager() {
|
||||
return myPlatformTransactionManager;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,6 @@ public class DummyService {
|
|||
private static final Logger ourLog = getLogger(DummyService.class);
|
||||
|
||||
public void test() {
|
||||
ourLog.warn("test");
|
||||
ourLog.warn("test testing again");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.batch.svc;
|
||||
|
||||
import ca.uhn.fhir.jpa.batch.BaseBatchR4Test;
|
||||
import ca.uhn.fhir.jpa.entity.EmpiLink;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BatchSvcTest extends BaseBatchR4Test {
|
||||
|
|
|
@ -29,6 +29,7 @@ public class EmpiLinkSvcTest extends BaseEmpiR4Test {
|
|||
myExpungeEverythingService.expungeEverythingByType(EmpiLink.class);
|
||||
super.after();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compareEmptyPatients() {
|
||||
Patient patient = new Patient();
|
||||
|
|
Loading…
Reference in New Issue