Merge branch 'adamkulawik-tech/move-tests-to-inmemoryDB'
This commit is contained in:
@@ -33,6 +33,11 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.liquibase</groupId>
|
||||
<artifactId>liquibase-core</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
spring.main.banner-mode=off
|
||||
spring.jpa.database=default
|
||||
spring.jpa.generate-ddl=false
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
|
||||
spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_ON_EXIT=FALSE
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=sa
|
||||
spring.datasource.driver-class-name=org.h2.Driver
|
||||
|
||||
spring.liquibase.change-log=classpath:/schema/db.changelog.xml
|
||||
|
||||
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n
|
||||
logging.level.org.hibernate.SQL=debug
|
||||
logging.level.=error
|
||||
|
||||
@@ -68,6 +68,12 @@
|
||||
<version>1.7.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
@@ -85,6 +91,29 @@
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.time.Clock;
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EntityScan(
|
||||
basePackageClasses = {Configuration.class, Jsr310JpaConverters.class}
|
||||
basePackageClasses = [ForecastingAdaptersConfiguration.class, Jsr310JpaConverters.class]
|
||||
)
|
||||
public class Configuration {
|
||||
public class ForecastingAdaptersConfiguration {
|
||||
@Bean
|
||||
public Clock clock() {
|
||||
return Clock.systemDefaultZone();
|
||||
@@ -12,7 +12,7 @@ import static DeliveryPlannerDefinition.of
|
||||
import static io.dddbyexamples.factory.demand.forecasting.Demand.Schema.*
|
||||
|
||||
@SpringBootTest
|
||||
class DeliveryPlannerDefinitionTest extends Specification {
|
||||
class DeliveryPlannerDefinitionSpec extends Specification {
|
||||
|
||||
@Autowired
|
||||
DeliveryPlannerDefinitionDao dao
|
||||
@@ -19,7 +19,7 @@ import java.time.ZoneId
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
@Commit
|
||||
class ProductDemandORMRepositoryTest extends Specification {
|
||||
class ProductDemandORMRepositorySpec extends Specification {
|
||||
|
||||
def clock = Clock.fixed(Instant.now(), ZoneId.systemDefault())
|
||||
def events = Mock(DemandEvents)
|
||||
@@ -62,6 +62,13 @@
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
@@ -79,6 +86,29 @@
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import java.time.Clock;
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EntityScan(
|
||||
basePackageClasses = {Configuration.class, Jsr310JpaConverters.class}
|
||||
basePackageClasses = [ProductionManagementAdaptersConfiguration.class, Jsr310JpaConverters.class]
|
||||
)
|
||||
public class Configuration {
|
||||
public class ProductionManagementAdaptersConfiguration {
|
||||
@Bean
|
||||
public Clock clock() {
|
||||
return Clock.systemDefaultZone();
|
||||
@@ -7,7 +7,7 @@ import spock.lang.Specification
|
||||
import static java.util.Collections.singletonList
|
||||
|
||||
@SpringBootTest
|
||||
class ProductDescriptionPersistenceTest extends Specification {
|
||||
class ProductDescriptionPersistenceSpec extends Specification {
|
||||
|
||||
@Autowired
|
||||
ProductDescriptionDao dao
|
||||
@@ -68,6 +68,13 @@
|
||||
<version>1.7.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
@@ -85,6 +92,29 @@
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.time.Clock;
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EntityScan(
|
||||
basePackageClasses = {Configuration.class, Jsr310JpaConverters.class}
|
||||
basePackageClasses = [PredictionAdaptersConfiguration.class, Jsr310JpaConverters.class]
|
||||
)
|
||||
public class Configuration {
|
||||
public class PredictionAdaptersConfiguration {
|
||||
@Bean
|
||||
public Clock clock() {
|
||||
return Clock.systemDefaultZone();
|
||||
@@ -18,7 +18,7 @@ import static io.dddbyexamples.factory.shortages.prediction.monitoring.NewShorta
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
@Commit
|
||||
class ShortagePredictionProcessORMRepositoryTest extends Specification {
|
||||
class ShortagePredictionProcessORMRepositorySpec extends Specification {
|
||||
|
||||
def now = LocalDateTime.now()
|
||||
def refNo = "3009000"
|
||||
Reference in New Issue
Block a user