Skip to content

Commit

Permalink
Simplified project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cer committed Jan 11, 2017
1 parent cc65f39 commit 6c84100
Show file tree
Hide file tree
Showing 146 changed files with 528 additions and 781 deletions.
14 changes: 0 additions & 14 deletions java-spring/accounts-command-side-backend/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions java-spring/accounts-command-side-service/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions java-spring/accounts-command-side-service/build.gradle

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions java-spring/accounts-command-side-web/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions java-spring/accounts-query-side-service/Dockerfile

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions java-spring/accounts-query-side-web/build.gradle

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions java-spring/accounts-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM java:openjdk-8u91-jdk
CMD java ${JAVA_OPTS} -jar accounts-service.jar
EXPOSE 8080
COPY build/libs/accounts-service.jar .
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
apply plugin: VerifyMongoDBConfigurationPlugin
apply plugin: VerifyEventStoreEnvironmentPlugin
apply plugin: EventuateDependencyPlugin

apply plugin: 'spring-boot'

dependencies {
compile project(":customers-query-side-web")
compile project(":common-backend")
compile project(":common-swagger")

compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"

testCompile project(":testutil")
testCompile project(":customers-command-side-service")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion"
}

test {
ignoreFailures System.getenv("EVENTUATE_API_KEY_ID") == null
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice;

import io.eventuate.javaclient.driver.EventuateDriverConfiguration;
import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web.AccountsWebConfiguration;
import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({AccountsWebConfiguration.class, EventuateDriverConfiguration.class, CommonSwaggerConfiguration.class})
@EnableAutoConfiguration
@ComponentScan
public class AccountsServiceMain {

public static void main(String[] args) {
SpringApplication.run(AccountsServiceMain.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

import io.eventuate.Event;
import io.eventuate.EventUtil;
Expand All @@ -7,7 +7,6 @@

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Account extends ReflectiveMutableCommandProcessingAggregate<Account, AccountCommand> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;


import io.eventuate.Command;

interface AccountCommand extends Command {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;


import io.eventuate.AggregateRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;


import io.eventuate.EntityWithIdAndVersion;
import io.eventuate.EventHandlerContext;
import io.eventuate.EventHandlerMethod;
import io.eventuate.EventSubscriber;
import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerToAccountDeleted;
import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.DebitRecordedEvent;
import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.MoneyTransferCreatedEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

import io.eventuate.AggregateRepository;
import io.eventuate.EventuateAggregateStore;
Expand All @@ -8,7 +8,7 @@

@Configuration
@EnableEventHandlers
public class AccountConfiguration {
public class AccountsBackendConfiguration {

@Bean
public AccountWorkflow accountWorkflow() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;

import io.eventuate.Aggregate;

package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

import java.math.BigDecimal;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

import java.math.BigDecimal;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

public class DeleteAccountCommand implements AccountCommand {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;


import java.math.BigDecimal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web;

import net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts.AccountService;
import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountService;
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.CreateAccountRequest;
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.CreateAccountResponse;
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.DeleteAccountResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web;

import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountsBackendConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({AccountsBackendConfiguration.class})
@ComponentScan
public class AccountsWebConfiguration {


}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice;

import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.CreateAccountRequest;
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.CreateAccountResponse;
Expand Down Expand Up @@ -33,10 +33,9 @@ private String baseUrl(String path) {


@Test
public void shouldCreateAccountsAndTransferMoney() {
public void shouldCreateAccounts() {
BigDecimal initialFromAccountBalance = new BigDecimal(500);
BigDecimal initialToAccountBalance = new BigDecimal(100);
BigDecimal amountToTransfer = new BigDecimal(150);
String customerId = "00000000-00000000";
String title = "My Account";

Expand All @@ -48,8 +47,6 @@ public void shouldCreateAccountsAndTransferMoney() {

Assert.assertNotNull(fromAccountId);
Assert.assertNotNull(toAccountId);


}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice;

import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web.AccountsWebConfiguration;
import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -12,7 +15,8 @@
import java.util.List;

@Configuration
@Import(AccountsCommandSideServiceConfiguration.class)
@Import({AccountsWebConfiguration.class, AuthConfiguration.class})
@EnableAutoConfiguration
public class AccountsCommandSideServiceTestConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;


import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractEntityEventTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.backend.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend;

import io.eventuate.Event;
import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountOpenedEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web.commandside.accounts;
package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web;

import org.junit.Before;
import org.junit.Test;
Expand Down
Loading

0 comments on commit 6c84100

Please sign in to comment.