Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpopikyardo committed Jan 23, 2017
1 parent a7a678c commit 2af6e40
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 29 deletions.
2 changes: 1 addition & 1 deletion multi-module/_build-and-test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fi

${DOCKER_COMPOSE?} build

${DOCKER_COMPOSE?} up -d commandsideservice querysideservice
${DOCKER_COMPOSE?} up -d todoservice todoviewservice

./wait-for-services.sh $DOCKER_HOST_IP 8081 8082

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
* Created by popikyardo on 23.03.16.
*/
@RestController
@RequestMapping(value = "/todos")
public class TodoHateoasController extends BaseController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
* Created by popikyardo on 23.03.16.
*/
public interface TodoUpdateService {

List<Todo> getAll();
Expand Down
4 changes: 2 additions & 2 deletions multi-module/docker-compose-common.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
commandsideservice:
todoservice:
build: ./todo-service/
restart: unless-stopped
ports:
- "8081:8080"

querysideservice:
todoviewservice:
build: ./todo-view-service/
restart: unless-stopped
ports:
Expand Down
8 changes: 4 additions & 4 deletions multi-module/docker-compose-eventuate-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ mysql:
- MYSQL_PASSWORD=mysqlpw


commandsideservice:
todoservice:
extends:
file: docker-compose-common.yml
service: commandsideservice
service: todoservice
links:
- mysql
- kafka
Expand All @@ -63,10 +63,10 @@ commandsideservice:
EVENTUATELOCAL_CDC_DB_USER_NAME: root
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword

querysideservice:
todoviewservice:
extends:
file: docker-compose-common.yml
service: querysideservice
service: todoviewservice
links:
- mysql
- kafka
Expand Down
8 changes: 4 additions & 4 deletions multi-module/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
commandsideservice:
todoservice:
extends:
file: docker-compose-common.yml
service: commandsideservice
service: todoservice
links:
- mysql
environment:
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate

querysideservice:
todoviewservice:
extends:
file: docker-compose-common.yml
service: querysideservice
service: todoviewservice
links:
- mysql
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Configuration;

/**
* Created by popikyardo on 18.03.16.
*/
@Configuration
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class E2ETestConfiguration extends BasicWebTestConfiguration {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.datasource.initialize=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
create table todo (
id varchar(255) PRIMARY KEY,
title varchar(255),
completed BOOLEAN,
order_id INTEGER,
deleted BOOLEAN
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@

spring.datasource.url=jdbc:mysql://localhost:3307/eventuate
spring.datasource.username=mysqluser
spring.datasource.password=mysqlpw
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.continueOnError=true
spring.datasource.initialize=false
spring.datasource.initialSize=0
spring.datasource.timeBetweenEvictionRunsMillis=5000
spring.datasource.minEvictableIdleTimeMillis=5000
spring.datasource.minIdle=0

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.hbm2ddl.auto=none
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false

jpa.hibernate.naming_strategy=org.hibernate.cfg.DefaultNamingStrategy
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@

spring.datasource.url=jdbc:mysql://localhost:3307/eventuate
spring.datasource.username=mysqluser
spring.datasource.password=mysqlpw
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.continueOnError=true
spring.datasource.initialize=false
spring.datasource.initialSize=0
spring.datasource.timeBetweenEvictionRunsMillis=5000
spring.datasource.minEvictableIdleTimeMillis=5000
spring.datasource.minIdle=0

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.hbm2ddl.auto=none
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false

jpa.hibernate.naming_strategy=org.hibernate.cfg.DefaultNamingStrategy
16 changes: 14 additions & 2 deletions single-module/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@

spring.datasource.url=jdbc:mysql://localhost:3307/eventuate
spring.datasource.username=mysqluser
spring.datasource.password=mysqlpw
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.continueOnError=true
spring.datasource.initialize=false
spring.datasource.initialSize=0
spring.datasource.timeBetweenEvictionRunsMillis=5000
spring.datasource.minEvictableIdleTimeMillis=5000
spring.datasource.minIdle=0

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.hbm2ddl.auto=none
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false

jpa.hibernate.ddl-auto=none
jpa.hibernate.naming_strategy=org.hibernate.cfg.DefaultNamingStrategy
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Configuration;

/**
* Created by popikyardo on 18.03.16.
*/
@Configuration
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class E2ETestConfiguration extends BasicWebTestConfiguration {
Expand Down
1 change: 1 addition & 0 deletions single-module/src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.datasource.initialize=true
7 changes: 7 additions & 0 deletions single-module/src/test/resources/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
create table todo (
id varchar(255) PRIMARY KEY,
title varchar(255),
completed BOOLEAN,
order_id INTEGER,
deleted BOOLEAN
);

0 comments on commit 2af6e40

Please sign in to comment.