From e0d0ccba1cf07170f31b805e8b2aa40589f2134c Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Fri, 23 Oct 2020 16:44:36 +0300 Subject: [PATCH] #44: Upgraded eventuate dependencies. Upgraded Spring boot. Upgraded gradle. Updated according the style guide. --- README.md | 43 +--- _build-and-test-all.sh | 70 ------ .../build.gradle | 9 + .../domain/events}/AccountChangedEvent.java | 2 +- .../domain/events}/AccountCreditedEvent.java | 2 +- ...ebitFailedDueToInsufficientFundsEvent.java | 2 +- .../domain/events}/AccountDebitedEvent.java | 2 +- .../domain/events/AccountDeletedEvent.java | 4 + .../accounts/domain/events}/AccountEvent.java | 4 +- .../domain/events}/AccountOpenedEvent.java | 2 +- .../AccountOpenEventSerializationTest.java | 7 +- .../accounts-service-api-web/build.gradle | 5 + .../webapi}/CreateAccountRequest.java | 2 +- .../webapi}/CreateAccountResponse.java | 2 +- .../webapi}/DeleteAccountResponse.java | 2 +- java-spring/accounts-service/Dockerfile | 7 +- java-spring/accounts-service/build.gradle | 28 ++- ...ration.java => AccountsConfiguration.java} | 9 +- .../accountsservice/AccountsServiceMain.java | 5 +- .../{backend => domain}/Account.java | 8 +- .../{backend => domain}/AccountCommand.java | 4 +- .../CreditAccountCommand.java | 2 +- .../DebitAccountCommand.java | 2 +- .../DeleteAccountCommand.java | 2 +- .../OpenAccountCommand.java | 2 +- .../{backend => service}/AccountService.java | 6 +- .../{backend => service}/AccountWorkflow.java | 10 +- .../web/AccountController.java | 8 +- .../web/AccountsWebConfiguration.java | 5 +- .../src/main/resources/application.properties | 5 + ...untsCommandSideServiceIntegrationTest.java | 19 +- ...tsCommandSideServiceTestConfiguration.java | 6 +- .../AccountEventTest.java | 3 +- .../{backend => service}/AccountTest.java | 6 +- .../web/AccountControllerIntegrationTest.java | 6 +- ...ontrollerIntegrationTestConfiguration.java | 3 +- .../build.gradle | 5 + .../view/webapi}/AccountHistoryResponse.java | 4 +- .../view/webapi}/GetAccountResponse.java | 2 +- .../view/webapi}/GetAccountsResponse.java | 2 +- java-spring/accounts-view-service/Dockerfile | 7 +- .../accounts-view-service/build.gradle | 21 +- ...ion.java => AccountViewConfiguration.java} | 9 +- .../AccountsViewServiceMain.java | 5 +- .../{backend => domain}/AccountInfo.java | 2 +- .../AccountInfoRepository.java | 4 +- .../AccountNotFoundException.java | 2 +- .../QuerySideDependencyChecker.java | 4 +- .../AccountInfoUpdateService.java | 16 +- .../AccountQueryService.java | 12 +- .../AccountQueryWorkflow.java | 20 +- .../{backend => service}/MoneyUtil.java | 2 +- .../web/AccountQueryController.java | 9 +- .../web/AccountViewWebConfiguration.java | 6 +- .../src/main/resources/application.properties | 5 + .../web/AccountInfoUpdateServiceTest.java | 25 +- ...countsQuerySideServiceIntegrationTest.java | 14 +- ...untsQuerySideServiceTestConfiguration.java | 6 +- .../api-gateway-service-api-web/build.gradle | 5 + .../apigateway/webapi}/AuthRequest.java | 2 +- .../apigateway/webapi}/ErrorResponse.java | 2 +- java-spring/api-gateway-service/Dockerfile | 7 +- java-spring/api-gateway-service/build.gradle | 9 +- .../ApiGatewayServiceConfiguration.java | 6 +- .../controller/AuthController.java | 12 +- .../controller/GatewayController.java | 6 +- .../utils/ContentRequestTransformer.java | 4 +- .../utils/HeadersRequestTransformer.java | 5 +- .../utils/ProxyRequestTransformer.java | 4 +- .../utils/URLRequestTransformer.java | 10 +- .../AuthControllerIntegrationTest.java | 13 +- ...ontrollerIntegrationTestConfiguration.java | 6 +- .../backend-integration-tests/build.gradle | 15 -- .../backend/BankingTestConfiguration.java | 15 -- .../backend/MoneyTransferIntegrationTest.java | 92 ------- .../AccountQuerySideIntegrationTest.java | 66 ----- .../AccountQuerySideTestConfiguration.java | 16 -- .../CustomerQuerySideIntegrationTest.java | 75 ------ .../CustomerQuerySideTestConfiguration.java | 14 -- .../build-and-test-all-eventuate-local.sh | 6 - java-spring/build-and-test-all.sh | 54 +++- java-spring/build.gradle | 31 ++- .../groovy/EventuateDependencyPlugin.groovy | 16 -- .../VerifyEventStoreEnvironmentPlugin.groovy | 15 -- java-spring/common-auth-web/build.gradle | 12 - java-spring/common-auth/build.gradle | 6 +- .../banking/commonauth/AuthConfiguration.java | 64 +---- .../commonauth/AuthConfigurationAdapter.java | 63 +++++ .../banking/commonauth/AuthProperties.java | 6 +- .../AuthPropertiesConfiguration.java | 14 ++ .../commonauth/CustomerAuthRepository.java | 8 +- .../commonauth/CustomerAuthService.java | 10 +- .../src/main/resources/auth.properties | 4 +- java-spring/common-backend/build.gradle | 13 - .../common/accounts/AccountDeletedEvent.java | 4 - .../src/main/resources/logback.xml | 22 -- java-spring/common-swagger/build.gradle | 6 +- .../CommonSwaggerConfiguration.java | 33 +-- .../build.gradle | 7 + .../events}/CustomerAddedToAccount.java | 2 +- .../domain/events}/CustomerCreatedEvent.java | 2 +- .../domain/events}/CustomerEvent.java | 4 +- .../events}/CustomerToAccountDeleted.java | 2 +- .../customers-service-api-web/build.gradle | 5 + .../webapi}/AddToAccountResponse.java | 2 +- .../customers/webapi}/CustomerResponse.java | 3 +- java-spring/customers-service/Dockerfile | 7 +- java-spring/customers-service/build.gradle | 22 +- ...ration.java => CustomerConfiguration.java} | 8 +- .../CustomersServiceMain.java | 11 +- .../AddToAccountCommand.java | 2 +- .../CreateCustomerCommand.java | 2 +- .../{backend => domain}/Customer.java | 8 +- .../{backend => domain}/CustomerCommand.java | 4 +- .../DeleteToAccountCommand.java | 2 +- .../{backend => service}/CustomerService.java | 7 +- .../web/CustomerController.java | 8 +- .../web/CustomersWebConfiguration.java | 6 +- .../src/main/resources/application.properties | 5 + ...mersCommandSideServiceIntegrationTest.java | 14 +- ...rsCommandSideServiceTestConfiguration.java | 16 +- .../CustomerEventTest.java | 3 +- .../{backend => service}/CustomerTest.java | 6 +- .../build.gradle | 2 - .../view/commonapi/CustomerView.java} | 8 +- .../build.gradle | 7 + .../view/webapi/CustomersQueryResponse.java | 28 +++ java-spring/customers-view-service/Dockerfile | 7 +- .../customers-view-service/build.gradle | 23 +- ...on.java => CustomerViewConfiguration.java} | 11 +- .../CustomersViewServiceMain.java | 15 +- .../backend/CustomerViewRepository.java | 11 - .../domain/CustomerViewRepository.java | 11 + .../ViewDependencyChecker.java | 4 +- .../CustomerInfoUpdateService.java | 13 +- .../CustomerQueryService.java | 17 +- .../CustomerQueryWorkflow.java | 10 +- .../web/CustomerQueryController.java | 9 +- .../web/CustomersQueryResponse.java | 28 --- .../web/CustomersViewWebConfiguration.java | 6 +- .../src/main/resources/application.properties | 5 + ...tomersQuerySideServiceIntegrationTest.java | 55 ---- ...mersQuerySideServiceTestConfiguration.java | 32 --- .../CustomerInfoUpdateServiceTest.java | 42 ++-- java-spring/docker-compose-common.yml | 54 ---- .../docker-compose-eventuate-local.yml | 161 ------------ java-spring/docker-compose.yml | 235 ++++++++++++++---- java-spring/gradle.properties | 16 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../rest-api-integration-tests/build.gradle | 14 -- .../banking/web/BankingAuthTest.java | 64 ----- .../web/BankingWebIntegrationTest.java | 49 ---- .../web/BankingWebTestConfiguration.java | 51 ---- java-spring/set-env.sh | 21 -- java-spring/settings.gradle | 19 +- java-spring/testutil/build.gradle | 10 +- .../testutil/AbstractEntityEventTest.java | 2 +- .../testutil/AbstractRestAPITest.java | 15 +- .../testutil/CustomersTestUtils.java | 16 +- .../build.gradle | 7 + .../domain/events}/CreditRecordedEvent.java | 3 +- .../domain/events}/DebitRecordedEvent.java | 2 +- .../events}/FailedDebitRecordedEvent.java | 2 +- .../events}/MoneyTransferCreatedEvent.java | 2 +- .../domain/events}/MoneyTransferEvent.java | 4 +- .../domain/events}/TransferDetails.java | 7 +- .../transactions-service-api-web/build.gradle | 5 + .../webapi}/CreateMoneyTransferRequest.java | 2 +- .../webapi}/CreateMoneyTransferResponse.java | 2 +- java-spring/transactions-service/Dockerfile | 7 +- java-spring/transactions-service/build.gradle | 20 +- ...n.java => MoneyTransferConfiguration.java} | 8 +- .../TransactionsServiceMain.java | 9 +- .../CreateMoneyTransferCommand.java | 5 +- .../{backend => domain}/MoneyTransfer.java | 8 +- .../MoneyTransferCommand.java | 4 +- .../RecordCreditCommand.java | 2 +- .../RecordDebitCommand.java | 2 +- .../RecordDebitFailedCommand.java | 2 +- .../MoneyTransferService.java | 7 +- .../MoneyTransferWorkflow.java | 12 +- .../web/MoneyTransferController.java | 9 +- .../web/MoneyTransferWebConfiguration.java | 6 +- .../src/main/resources/application.properties | 5 + ...ionsCommandSideServiceIntegrationTest.java | 12 +- ...nsCommandSideServiceTestConfiguration.java | 4 +- .../MoneyTransferEventTest.java | 3 +- ...oneyTransferControllerIntegrationTest.java | 6 +- ...ontrollerIntegrationTestConfiguration.java | 5 +- scala-spring/README.md | 37 --- .../build.gradle | 5 - .../examples/bank/accounts/Account.scala | 41 --- .../bank/accounts/AccountCommands.scala | 13 - .../bank/accounts/AccountConfiguration.scala | 21 -- .../bank/accounts/AccountService.scala | 12 - .../TransferWorkflowAccountHandlers.scala | 27 -- .../build.gradle | 22 -- ...ountsCommandSideServiceConfiguration.scala | 25 -- .../main/AccountsCommandSideServiceMain.scala | 10 - ...ntsCommandSideServiceIntegrationTest.scala | 32 --- ...sCommandSideServiceTestConfiguration.scala | 27 -- .../accounts-command-side-web/build.gradle | 10 - .../CommandSideWebAccountsConfiguration.scala | 11 - .../controllers/AccountController.scala | 20 -- .../controllers/CreateAccountRequest.scala | 3 - .../controllers/CreateAccountResponse.scala | 7 - .../accounts-query-side-backend/build.gradle | 16 -- .../examples/bank/queryside/AccountInfo.scala | 14 -- .../queryside/AccountInfoQueryService.scala | 17 -- .../queryside/AccountInfoUpdateService.scala | 95 ------- .../queryside/QuerySideConfiguration.scala | 20 -- .../QuerysideDependencyChecker.scala | 26 -- .../accounts-query-side-service/build.gradle | 23 -- ...ccountsQuerySideServiceConfiguration.scala | 24 -- .../main/AccountsQuerySideServiceMain.scala | 10 - ...ountsQuerySideServiceIntegrationTest.scala | 30 --- ...ntsQuerySideServiceTestConfiguration.scala | 27 -- .../accounts-query-side-web/build.gradle | 16 -- .../queryside/QuerySideWebConfiguration.scala | 13 - .../AccountQuerySideController.scala | 18 -- .../backend-integration-tests/build.gradle | 18 -- .../bank/MoneyTransferIntegrationTest.scala | 101 -------- .../config/BankingTestConfiguration.scala | 15 -- scala-spring/build-and-test-all.sh | 3 - scala-spring/build.gradle | 29 --- .../VerifyEventStoreEnvironmentPlugin.groovy | 15 -- .../VerifyMongoDBConfigurationPlugin.groovy | 15 -- scala-spring/common-backend/build.gradle | 10 - .../src/main/resources/logback.xml | 22 -- .../common/accounts/AccountEvents.scala | 18 -- .../backend/common/accounts/package-info.java | 2 - .../transactions/TransactionEvents.scala | 8 - .../common/transactions/TransferDetails.scala | 6 - .../common/transactions/package-info.java | 2 - scala-spring/common-web/build.gradle | 10 - .../examples/bank/web/util/WebUtil.scala | 20 -- scala-spring/docker-compose.yml | 46 ---- scala-spring/e2e-test/build.gradle | 19 -- .../examples/bank/web/EndToEndTest.scala | 68 ----- scala-spring/gradle.properties | 10 - .../gradle/gradle/wrapper/gradle-wrapper.jar | Bin 51017 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - scala-spring/gradle/gradlew | 164 ------------ scala-spring/gradle/gradlew.bat | 90 ------- .../gradle/wrapper/gradle-wrapper.jar | Bin 50514 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - scala-spring/gradlew | 164 ------------ scala-spring/gradlew.bat | 90 ------- scala-spring/handy-curl-commands.sh | 36 --- scala-spring/monolithic-service/build.gradle | 22 -- .../bank/web/BankingWebAppConfiguration.scala | 31 --- .../examples/bank/web/main/BankingMain.scala | 10 - .../bank/web/BankWebIntegrationTest.scala | 70 ------ .../web/BankingWebAppTestConfiguration.scala | 27 -- scala-spring/settings.gradle | 23 -- .../build.gradle | 5 - .../bank/transactions/MoneyTransfer.scala | 46 ---- .../transactions/MoneyTransferCommands.scala | 15 -- .../MoneyTransferEventHandlers.scala | 34 --- .../transactions/MoneyTransferService.scala | 13 - .../TransactionConfiguration.scala | 18 -- .../build.gradle | 22 -- ...tionsCommandSideServiceConfiguration.scala | 24 -- .../TransactionsCommandSideServiceMain.scala | 10 - ...onsCommandSideServiceIntegrationTest.scala | 30 --- ...sCommandSideServiceTestConfiguration.scala | 27 -- .../build.gradle | 10 - ...mandSideWebTransactionsConfiguration.scala | 11 - .../CreateMoneyTransferResponse.scala | 11 - .../controllers/MoneyTransferController.scala | 30 --- wait-for-docker-services.sh | 9 - wait-for-services.sh | 26 -- 272 files changed, 998 insertions(+), 3851 deletions(-) delete mode 100755 _build-and-test-all.sh create mode 100644 java-spring/accounts-service-api-messaging/build.gradle rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountChangedEvent.java (84%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountCreditedEvent.java (74%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountDebitFailedDueToInsufficientFundsEvent.java (81%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountDebitedEvent.java (74%) create mode 100644 java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDeletedEvent.java rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountEvent.java (58%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts => accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountOpenedEvent.java (89%) rename java-spring/{common-backend/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-service-api-messaging/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events}/AccountOpenEventSerializationTest.java (64%) create mode 100644 java-spring/accounts-service-api-web/build.gradle rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi}/CreateAccountRequest.java (94%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi}/CreateAccountResponse.java (81%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi}/DeleteAccountResponse.java (81%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend/AccountsBackendConfiguration.java => AccountsConfiguration.java} (65%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/Account.java (76%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/AccountCommand.java (58%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/CreditAccountCommand.java (95%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/DebitAccountCommand.java (95%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/DeleteAccountCommand.java (86%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => domain}/OpenAccountCommand.java (97%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => service}/AccountService.java (69%) rename java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => service}/AccountWorkflow.java (70%) create mode 100644 java-spring/accounts-service/src/main/resources/application.properties rename java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => service}/AccountEventTest.java (73%) rename java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/{backend => service}/AccountTest.java (70%) create mode 100644 java-spring/accounts-view-service-api-web/build.gradle rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi}/AccountHistoryResponse.java (75%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi}/GetAccountResponse.java (92%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts => accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi}/GetAccountsResponse.java (83%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend/AccountViewBackendConfiguration.java => AccountViewConfiguration.java} (66%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => domain}/AccountInfo.java (98%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => domain}/AccountInfoRepository.java (66%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => domain}/AccountNotFoundException.java (90%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => domain}/QuerySideDependencyChecker.java (91%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => service}/AccountInfoUpdateService.java (82%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => service}/AccountQueryService.java (52%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => service}/AccountQueryWorkflow.java (82%) rename java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/{backend => service}/MoneyUtil.java (90%) create mode 100644 java-spring/accounts-view-service/src/main/resources/application.properties create mode 100644 java-spring/api-gateway-service-api-web/build.gradle rename java-spring/{common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model => api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi}/AuthRequest.java (88%) rename java-spring/{common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model => api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi}/ErrorResponse.java (81%) rename java-spring/{common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth => api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway}/controller/AuthController.java (79%) rename java-spring/{common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller => api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway}/AuthControllerIntegrationTest.java (84%) rename java-spring/{common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller => api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway}/AuthControllerIntegrationTestConfiguration.java (70%) delete mode 100644 java-spring/backend-integration-tests/build.gradle delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/BankingTestConfiguration.java delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/MoneyTransferIntegrationTest.java delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideIntegrationTest.java delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideTestConfiguration.java delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideIntegrationTest.java delete mode 100644 java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideTestConfiguration.java delete mode 100755 java-spring/build-and-test-all-eventuate-local.sh delete mode 100644 java-spring/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy delete mode 100644 java-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy delete mode 100644 java-spring/common-auth-web/build.gradle create mode 100755 java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfigurationAdapter.java create mode 100755 java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthPropertiesConfiguration.java delete mode 100644 java-spring/common-backend/build.gradle delete mode 100644 java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDeletedEvent.java delete mode 100644 java-spring/common-backend/src/main/resources/logback.xml create mode 100644 java-spring/customers-service-api-messaging/build.gradle rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers => customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events}/CustomerAddedToAccount.java (86%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers => customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events}/CustomerCreatedEvent.java (85%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers => customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events}/CustomerEvent.java (62%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers => customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events}/CustomerToAccountDeleted.java (81%) create mode 100644 java-spring/customers-service-api-web/build.gradle rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers => customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi}/AddToAccountResponse.java (80%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers => customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi}/CustomerResponse.java (83%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend/CustomerBackendConfiguration.java => CustomerConfiguration.java} (70%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => domain}/AddToAccountCommand.java (95%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => domain}/CreateCustomerCommand.java (95%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => domain}/Customer.java (76%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => domain}/CustomerCommand.java (57%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => domain}/DeleteToAccountCommand.java (95%) rename java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => service}/CustomerService.java (70%) create mode 100644 java-spring/customers-service/src/main/resources/application.properties rename java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => service}/CustomerEventTest.java (73%) rename java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/{backend => service}/CustomerTest.java (72%) rename java-spring/{customers-query-side-common => customers-view-service-api-common}/build.gradle (76%) rename java-spring/{customers-query-side-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/common/QuerySideCustomer.java => customers-view-service-api-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/commonapi/CustomerView.java} (85%) create mode 100644 java-spring/customers-view-service-api-web/build.gradle create mode 100644 java-spring/customers-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/webapi/CustomersQueryResponse.java rename java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend/CustomerViewBackendConfiguration.java => CustomerViewConfiguration.java} (66%) delete mode 100644 java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewRepository.java create mode 100644 java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/CustomerViewRepository.java rename java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend => domain}/ViewDependencyChecker.java (91%) rename java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend => service}/CustomerInfoUpdateService.java (86%) rename java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend => service}/CustomerQueryService.java (51%) rename java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend => service}/CustomerQueryWorkflow.java (80%) delete mode 100644 java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersQueryResponse.java create mode 100644 java-spring/customers-view-service/src/main/resources/application.properties delete mode 100644 java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceIntegrationTest.java delete mode 100644 java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceTestConfiguration.java rename java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/{backend => service}/CustomerInfoUpdateServiceTest.java (57%) delete mode 100644 java-spring/docker-compose-common.yml delete mode 100644 java-spring/docker-compose-eventuate-local.yml delete mode 100644 java-spring/rest-api-integration-tests/build.gradle delete mode 100644 java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java delete mode 100644 java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java delete mode 100644 java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebTestConfiguration.java delete mode 100644 java-spring/set-env.sh create mode 100644 java-spring/transactions-service-api-messaging/build.gradle rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/CreditRecordedEvent.java (76%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/DebitRecordedEvent.java (76%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/FailedDebitRecordedEvent.java (77%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/MoneyTransferCreatedEvent.java (77%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/MoneyTransferEvent.java (56%) rename java-spring/{common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions => transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events}/TransferDetails.java (82%) create mode 100644 java-spring/transactions-service-api-web/build.gradle rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions => transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi}/CreateMoneyTransferRequest.java (93%) rename java-spring/{common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions => transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi}/CreateMoneyTransferResponse.java (79%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend/MoneyTransferBackendConfiguration.java => MoneyTransferConfiguration.java} (65%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/CreateMoneyTransferCommand.java (72%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/MoneyTransfer.java (73%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/MoneyTransferCommand.java (54%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/RecordCreditCommand.java (84%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/RecordDebitCommand.java (84%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => domain}/RecordDebitFailedCommand.java (84%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => service}/MoneyTransferService.java (60%) rename java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => service}/MoneyTransferWorkflow.java (59%) create mode 100644 java-spring/transactions-service/src/main/resources/application.properties rename java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/{backend => service}/MoneyTransferEventTest.java (71%) delete mode 100644 scala-spring/README.md delete mode 100644 scala-spring/accounts-command-side-backend/build.gradle delete mode 100644 scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/Account.scala delete mode 100644 scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountCommands.scala delete mode 100644 scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountConfiguration.scala delete mode 100644 scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountService.scala delete mode 100644 scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/TransferWorkflowAccountHandlers.scala delete mode 100644 scala-spring/accounts-command-side-service/build.gradle delete mode 100644 scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceConfiguration.scala delete mode 100644 scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsCommandSideServiceMain.scala delete mode 100644 scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceIntegrationTest.scala delete mode 100644 scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceTestConfiguration.scala delete mode 100644 scala-spring/accounts-command-side-web/build.gradle delete mode 100644 scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/CommandSideWebAccountsConfiguration.scala delete mode 100644 scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/AccountController.scala delete mode 100644 scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountRequest.scala delete mode 100644 scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountResponse.scala delete mode 100644 scala-spring/accounts-query-side-backend/build.gradle delete mode 100644 scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfo.scala delete mode 100644 scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoQueryService.scala delete mode 100644 scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoUpdateService.scala delete mode 100644 scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerySideConfiguration.scala delete mode 100644 scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerysideDependencyChecker.scala delete mode 100644 scala-spring/accounts-query-side-service/build.gradle delete mode 100644 scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceConfiguration.scala delete mode 100644 scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsQuerySideServiceMain.scala delete mode 100644 scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceIntegrationTest.scala delete mode 100644 scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceTestConfiguration.scala delete mode 100644 scala-spring/accounts-query-side-web/build.gradle delete mode 100644 scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/QuerySideWebConfiguration.scala delete mode 100644 scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/controllers/AccountQuerySideController.scala delete mode 100644 scala-spring/backend-integration-tests/build.gradle delete mode 100644 scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/MoneyTransferIntegrationTest.scala delete mode 100644 scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/config/BankingTestConfiguration.scala delete mode 100755 scala-spring/build-and-test-all.sh delete mode 100644 scala-spring/build.gradle delete mode 100644 scala-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy delete mode 100644 scala-spring/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy delete mode 100644 scala-spring/common-backend/build.gradle delete mode 100644 scala-spring/common-backend/src/main/resources/logback.xml delete mode 100644 scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/AccountEvents.scala delete mode 100644 scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/package-info.java delete mode 100644 scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransactionEvents.scala delete mode 100644 scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransferDetails.scala delete mode 100644 scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/package-info.java delete mode 100644 scala-spring/common-web/build.gradle delete mode 100644 scala-spring/common-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/util/WebUtil.scala delete mode 100644 scala-spring/docker-compose.yml delete mode 100644 scala-spring/e2e-test/build.gradle delete mode 100644 scala-spring/e2e-test/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.scala delete mode 100644 scala-spring/gradle.properties delete mode 100644 scala-spring/gradle/gradle/wrapper/gradle-wrapper.jar delete mode 100644 scala-spring/gradle/gradle/wrapper/gradle-wrapper.properties delete mode 100755 scala-spring/gradle/gradlew delete mode 100644 scala-spring/gradle/gradlew.bat delete mode 100644 scala-spring/gradle/wrapper/gradle-wrapper.jar delete mode 100644 scala-spring/gradle/wrapper/gradle-wrapper.properties delete mode 100755 scala-spring/gradlew delete mode 100644 scala-spring/gradlew.bat delete mode 100644 scala-spring/handy-curl-commands.sh delete mode 100644 scala-spring/monolithic-service/build.gradle delete mode 100644 scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppConfiguration.scala delete mode 100644 scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/BankingMain.scala delete mode 100644 scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankWebIntegrationTest.scala delete mode 100644 scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppTestConfiguration.scala delete mode 100644 scala-spring/settings.gradle delete mode 100644 scala-spring/transactions-command-side-backend/build.gradle delete mode 100644 scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransfer.scala delete mode 100644 scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferCommands.scala delete mode 100644 scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferEventHandlers.scala delete mode 100644 scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferService.scala delete mode 100644 scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/TransactionConfiguration.scala delete mode 100644 scala-spring/transactions-command-side-service/build.gradle delete mode 100644 scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceConfiguration.scala delete mode 100644 scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/TransactionsCommandSideServiceMain.scala delete mode 100644 scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceIntegrationTest.scala delete mode 100644 scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceTestConfiguration.scala delete mode 100644 scala-spring/transactions-command-side-web/build.gradle delete mode 100644 scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/CommandSideWebTransactionsConfiguration.scala delete mode 100644 scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/CreateMoneyTransferResponse.scala delete mode 100644 scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/MoneyTransferController.scala delete mode 100755 wait-for-docker-services.sh delete mode 100755 wait-for-services.sh diff --git a/README.md b/README.md index dedd799..8ba6f26 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,7 @@ There is also an [API gateway](http://microservices.io/patterns/apigateway.html) # About the examples -There are currently the following versions of the example application: - - * java-spring - a Java and Spring Boot example - * scala-spring - a Scala and Spring Boot example (NOTE: this version is lagging the Java Spring and hasn't been updated in a longtime.) - -Other examples will be added shortly including a Scala/Play example. +There is currently a Java and Spring Boot example: java-spring For more information, please see the [wiki](../../wiki) @@ -63,9 +58,6 @@ It provides a simple yet powerful event-driven programming model that is based o Eventuate solves the distributed data management problems inherent in a microservice architecture. It consists of a scalable, distributed event store and client libraries for various languages and frameworks including Java, Scala, and the Spring framework. -There are two versions of Eventuate: - -* [Eventuate SaaS server](http://eventuate.io/usingeventuate.html) - this is a full featured event store that is hosted on AWS * [Eventuate Local](http://eventuate.io/usingeventuate.html) - an open-source event store that is built using MySQL and Kafka There is also an embedded test event store, which is great for integration tests. @@ -78,46 +70,19 @@ You just need to have Java 8 installed. The details of how to build and run the services depend slightly on whether you are using Eventuate SaaS or Eventuate Local. -## Building and running using Eventuate SaaS - -First, must [sign up to get your credentials](https://signup.eventuate.io/) in order to get free access to the SaaS version. - -Next, build the application - -``` -cd java-spring -./gradlew assemble -``` - -Next, you can launch the services using [Docker Compose](https://docs.docker.com/compose/): - -``` -docker-compose up -d -``` - -Finally, you can open the home page, which is served up by the API Gateway: `http://$DOCKER_HOST_IP:8080` - -Note: `DOCKER_HOST_IP` is the IP address of the machine where Docker is running, e.g. the IP address of the VirtualBox VM. - ## Building and running using Eventuate Local First, build the application ``` cd java-spring -./gradlew assemble -P eventuateDriver=local +./gradlew assemble ``` Next, launch the services using [Docker Compose](https://docs.docker.com/compose/): ``` -export DOCKER_HOST_IP=... -docker-compose -f docker-compose-eventuate-local.yml up -d +./gradlew mysqlbinlogComposeUp ``` -Note: You need to set `DOCKER_HOST_IP` before running Docker Compose. -This must be an IP address or resolvable hostname. -It cannot be `localhost`. -See this [guide to setting `DOCKER_HOST_IP`](http://eventuate.io/docs/usingdocker.html) for more information. - -Finally, you can open the home page, which is served up by the API Gateway: `http://$DOCKER_HOST_IP:8080` +Finally, you can open the home page, which is served up by the API Gateway: `http://localhost:8080` diff --git a/_build-and-test-all.sh b/_build-and-test-all.sh deleted file mode 100755 index b5187d5..0000000 --- a/_build-and-test-all.sh +++ /dev/null @@ -1,70 +0,0 @@ -#! /bin/bash - -set -e - -if [ -z "$DOCKER_HOST_IP" ] ; then - if [ -z "$DOCKER_HOST" ] ; then - export DOCKER_HOST_IP=`hostname` - else - echo using ${DOCKER_HOST?} - XX=${DOCKER_HOST%\:*} - export DOCKER_HOST_IP=${XX#tcp\:\/\/} - fi - echo set DOCKER_HOST_IP $DOCKER_HOST_IP -fi - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -DOCKER_COMPOSE="docker-compose -p event-sourcing-examples" - -if [ "$1" = "-f" ] ; then - shift; - DOCKER_COMPOSE="$DOCKER_COMPOSE -f ${1?}" - shift -fi - -if [ "$1" = "--use-existing" ] ; then - shift; -else - ${DOCKER_COMPOSE?} stop - ${DOCKER_COMPOSE?} rm -v --force -fi - -NO_RM=false - -if [ "$1" = "--no-rm" ] ; then - NO_RM=true - shift -fi - -${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES - - -if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then - export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP?}/mydb - echo Set SPRING_DATA_MONGODB_URI $SPRING_DATA_MONGODB_URI -fi - -export SERVICE_HOST=$DOCKER_HOST_IP - -./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* build -x :e2e-test:test - -if [ -z "$EVENTUATE_LOCAL" ] && [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_API_KEY_SECRET" ] ; then - echo You must set EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET - exit -1 -fi - -${DOCKER_COMPOSE?} build - -${DOCKER_COMPOSE?} up -d - -$DIR/wait-for-services.sh $DOCKER_HOST_IP 8080 8081 8082 8083 8084 - -set -e - -./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS -a $* :e2e-test:cleanTest :e2e-test:test -P ignoreE2EFailures=false - -if [ $NO_RM = false ] ; then - ${DOCKER_COMPOSE?} stop - ${DOCKER_COMPOSE?} rm -v --force -fi diff --git a/java-spring/accounts-service-api-messaging/build.gradle b/java-spring/accounts-service-api-messaging/build.gradle new file mode 100644 index 0000000..2d375cc --- /dev/null +++ b/java-spring/accounts-service-api-messaging/build.gradle @@ -0,0 +1,9 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") + + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" + + testCompile "junit:junit:4.11" +} diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountChangedEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountChangedEvent.java similarity index 84% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountChangedEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountChangedEvent.java index 4506c45..5dfc589 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountChangedEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountChangedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; import java.math.BigDecimal; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountCreditedEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountCreditedEvent.java similarity index 74% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountCreditedEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountCreditedEvent.java index 2e1669f..54cd5c3 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountCreditedEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountCreditedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; import java.math.BigDecimal; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitFailedDueToInsufficientFundsEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitFailedDueToInsufficientFundsEvent.java similarity index 81% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitFailedDueToInsufficientFundsEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitFailedDueToInsufficientFundsEvent.java index 5bc24c1..5036db6 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitFailedDueToInsufficientFundsEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitFailedDueToInsufficientFundsEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; public class AccountDebitFailedDueToInsufficientFundsEvent extends AccountEvent { private String transactionId; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitedEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitedEvent.java similarity index 74% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitedEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitedEvent.java index 5cd010f..a85edba 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDebitedEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDebitedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; import java.math.BigDecimal; diff --git a/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDeletedEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDeletedEvent.java new file mode 100644 index 0000000..b79d8fa --- /dev/null +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountDeletedEvent.java @@ -0,0 +1,4 @@ +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; + +public class AccountDeletedEvent extends AccountEvent { +} diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountEvent.java similarity index 58% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountEvent.java index 5175669..cc2e7df 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountEvent.java @@ -1,8 +1,8 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; import io.eventuate.Event; import io.eventuate.EventEntity; -@EventEntity(entity="net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.Account") +@EventEntity(entity="net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account") public abstract class AccountEvent implements Event{ } diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountOpenedEvent.java b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenedEvent.java similarity index 89% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountOpenedEvent.java rename to java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenedEvent.java index 77fd89a..717afc7 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountOpenedEvent.java +++ b/java-spring/accounts-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; import java.math.BigDecimal; diff --git a/java-spring/common-backend/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountOpenEventSerializationTest.java b/java-spring/accounts-service-api-messaging/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenEventSerializationTest.java similarity index 64% rename from java-spring/common-backend/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountOpenEventSerializationTest.java rename to java-spring/accounts-service-api-messaging/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenEventSerializationTest.java index abe72dc..9802124 100644 --- a/java-spring/common-backend/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountOpenEventSerializationTest.java +++ b/java-spring/accounts-service-api-messaging/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/domain/events/AccountOpenEventSerializationTest.java @@ -1,7 +1,7 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events; -import io.eventuate.javaclient.commonimpl.JSonMapper; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountOpenedEvent; +import io.eventuate.common.json.mapper.JSonMapper; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountOpenedEvent; import org.junit.Assert; import org.junit.Test; @@ -14,7 +14,6 @@ public void shouldSerde() { AccountOpenedEvent event = new AccountOpenedEvent("00000000-00000000", "My Account", new BigDecimal(55), ""); String json = JSonMapper.toJson(event); - System.out.println("json=" + json); AccountOpenedEvent event2 = JSonMapper.fromJson(json, AccountOpenedEvent.class); diff --git a/java-spring/accounts-service-api-web/build.gradle b/java-spring/accounts-service-api-web/build.gradle new file mode 100644 index 0000000..7e5f160 --- /dev/null +++ b/java-spring/accounts-service-api-web/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") +} diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountRequest.java b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountRequest.java similarity index 94% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountRequest.java rename to java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountRequest.java index 77ddf22..15a4ce7 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountRequest.java +++ b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountRequest.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi; import javax.validation.constraints.DecimalMin; import javax.validation.constraints.NotNull; diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountResponse.java b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountResponse.java similarity index 81% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountResponse.java rename to java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountResponse.java index 743ba71..bac02cb 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/CreateAccountResponse.java +++ b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/CreateAccountResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi; public class CreateAccountResponse { diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/DeleteAccountResponse.java b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/DeleteAccountResponse.java similarity index 81% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/DeleteAccountResponse.java rename to java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/DeleteAccountResponse.java index f3fbbf2..5488fb4 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/DeleteAccountResponse.java +++ b/java-spring/accounts-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/webapi/DeleteAccountResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi; public class DeleteAccountResponse { diff --git a/java-spring/accounts-service/Dockerfile b/java-spring/accounts-service/Dockerfile index cfc6b09..7dc1f29 100644 --- a/java-spring/accounts-service/Dockerfile +++ b/java-spring/accounts-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar accounts-service.jar -EXPOSE 8080 -COPY build/libs/accounts-service.jar . \ No newline at end of file +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/accounts-service.jar service.jar \ No newline at end of file diff --git a/java-spring/accounts-service/build.gradle b/java-spring/accounts-service/build.gradle index a4f394d..ce3083a 100644 --- a/java-spring/accounts-service/build.gradle +++ b/java-spring/accounts-service/build.gradle @@ -1,21 +1,23 @@ -apply plugin: VerifyEventStoreEnvironmentPlugin -apply plugin: EventuateDependencyPlugin - -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' dependencies { - compile project(":common-backend") compile project(":common-swagger") - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" + compile project(":accounts-service-api-messaging") + compile project(":accounts-service-api-web") + + compile project(":transactions-service-api-messaging") + + compile "io.eventuate.local.java:eventuate-local-java-spring-jdbc:$eventuateLocalVersion" + compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-hateoas:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" + + testCompile project(":common-auth") testCompile project(":testutil") 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 + testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" + testCompile "io.eventuate.local.java:eventuate-client-java-spring-jdbc:$eventuateLocalVersion" } diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountsBackendConfiguration.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsConfiguration.java similarity index 65% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountsBackendConfiguration.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsConfiguration.java index fd64afb..9a9e9dc 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountsBackendConfiguration.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsConfiguration.java @@ -1,14 +1,18 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice; import io.eventuate.AggregateRepository; import io.eventuate.EventuateAggregateStore; import io.eventuate.javaclient.spring.EnableEventHandlers; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.AccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service.AccountService; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service.AccountWorkflow; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @EnableEventHandlers -public class AccountsBackendConfiguration { +public class AccountsConfiguration { @Bean public AccountWorkflow accountWorkflow() { @@ -25,7 +29,6 @@ public AccountService accountService(AggregateRepository accountRepository(EventuateAggregateStore eventStore) { return new AggregateRepository(Account.class, eventStore); } - } diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsServiceMain.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsServiceMain.java index f076881..8065eec 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsServiceMain.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsServiceMain.java @@ -1,8 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice; -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; +import io.eventuate.local.java.spring.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; @@ -10,7 +9,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({AccountsWebConfiguration.class, EventuateDriverConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({AccountsConfiguration.class, AccountsWebConfiguration.class, EventuateDriverConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class AccountsServiceMain { diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/Account.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/Account.java similarity index 76% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/Account.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/Account.java index a1d7941..588326b 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/Account.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/Account.java @@ -1,9 +1,13 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; import io.eventuate.Event; import io.eventuate.EventUtil; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.*; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountCreditedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDebitFailedDueToInsufficientFundsEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDebitedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDeletedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountOpenedEvent; import java.math.BigDecimal; import java.util.ArrayList; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountCommand.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/AccountCommand.java similarity index 58% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountCommand.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/AccountCommand.java index e746430..03396a8 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountCommand.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/AccountCommand.java @@ -1,7 +1,7 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; import io.eventuate.Command; -interface AccountCommand extends Command { +public interface AccountCommand extends Command { } diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/CreditAccountCommand.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/CreditAccountCommand.java similarity index 95% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/CreditAccountCommand.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/CreditAccountCommand.java index 7b166d0..2f2ab3d 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/CreditAccountCommand.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/CreditAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; import java.math.BigDecimal; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DebitAccountCommand.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DebitAccountCommand.java similarity index 95% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DebitAccountCommand.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DebitAccountCommand.java index f15a366..90c39c0 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DebitAccountCommand.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DebitAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; import java.math.BigDecimal; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DeleteAccountCommand.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DeleteAccountCommand.java similarity index 86% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DeleteAccountCommand.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DeleteAccountCommand.java index 29cc315..0db3e8b 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/DeleteAccountCommand.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/DeleteAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; public class DeleteAccountCommand implements AccountCommand { } diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/OpenAccountCommand.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/OpenAccountCommand.java similarity index 97% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/OpenAccountCommand.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/OpenAccountCommand.java index 5d58a3c..5edc58f 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/OpenAccountCommand.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/domain/OpenAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain; import java.math.BigDecimal; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountService.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountService.java similarity index 69% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountService.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountService.java index dcbf178..78de4fa 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountService.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountService.java @@ -1,8 +1,12 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service; import io.eventuate.AggregateRepository; import io.eventuate.EntityWithIdAndVersion; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.AccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.DeleteAccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.OpenAccountCommand; import java.math.BigDecimal; import java.util.concurrent.CompletableFuture; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountWorkflow.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountWorkflow.java similarity index 70% rename from java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountWorkflow.java rename to java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountWorkflow.java index 8a8006d..9b7c004 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountWorkflow.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountWorkflow.java @@ -1,12 +1,16 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service; import io.eventuate.EntityWithIdAndVersion; import io.eventuate.EventHandlerContext; import io.eventuate.EventHandlerMethod; import io.eventuate.EventSubscriber; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.DebitRecordedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.MoneyTransferCreatedEvent; + +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.CreditAccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.DebitAccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.MoneyTransferCreatedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.DebitRecordedEvent; import java.math.BigDecimal; import java.util.concurrent.CompletableFuture; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountController.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountController.java index 206eb5e..5d95109 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountController.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountController.java @@ -1,9 +1,9 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web; -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; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service.AccountService; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountRequest; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.DeleteAccountResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; diff --git a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountsWebConfiguration.java b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountsWebConfiguration.java index 92e764b..f94f3bc 100644 --- a/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountsWebConfiguration.java +++ b/java-spring/accounts-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountsWebConfiguration.java @@ -1,13 +1,12 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountsBackendConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({AccountsBackendConfiguration.class}) +@Import(CommonSwaggerConfiguration.class) @ComponentScan public class AccountsWebConfiguration { diff --git a/java-spring/accounts-service/src/main/resources/application.properties b/java-spring/accounts-service/src/main/resources/application.properties new file mode 100644 index 0000000..7c2c49c --- /dev/null +++ b/java-spring/accounts-service/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/eventuate +spring.datasource.username=mysqluser +spring.datasource.password=mysqlpw +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceIntegrationTest.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceIntegrationTest.java index 894d17c..7fa1e68 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceIntegrationTest.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceIntegrationTest.java @@ -1,27 +1,23 @@ 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; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountRequest; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountResponse; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.client.RestTemplate; import java.math.BigDecimal; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AccountsCommandSideServiceTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AccountsCommandSideServiceTestConfiguration.class) public class AccountsCommandSideServiceIntegrationTest { - @Value("${local.server.port}") + @LocalServerPort private int port; private String baseUrl(String path) { @@ -48,7 +44,4 @@ public void shouldCreateAccounts() { Assert.assertNotNull(fromAccountId); Assert.assertNotNull(toAccountId); } - - - } diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceTestConfiguration.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceTestConfiguration.java index 9701a55..f421aba 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceTestConfiguration.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/AccountsCommandSideServiceTestConfiguration.java @@ -1,9 +1,9 @@ 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 net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfigurationAdapter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -15,7 +15,7 @@ import java.util.List; @Configuration -@Import({AccountsWebConfiguration.class, AuthConfiguration.class}) +@Import({AccountsConfiguration.class, AccountsWebConfiguration.class, AuthConfigurationAdapter.class}) @EnableAutoConfiguration public class AccountsCommandSideServiceTestConfiguration { diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountEventTest.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountEventTest.java similarity index 73% rename from java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountEventTest.java rename to java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountEventTest.java index bd8d205..0fef2dd 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountEventTest.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountEventTest.java @@ -1,6 +1,7 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account; import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractEntityEventTest; public class AccountEventTest extends AbstractEntityEventTest { diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountTest.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountTest.java similarity index 70% rename from java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountTest.java rename to java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountTest.java index 77be8d4..25c4770 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/backend/AccountTest.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/service/AccountTest.java @@ -1,7 +1,9 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.service; import io.eventuate.Event; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountOpenedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountOpenedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.Account; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.domain.OpenAccountCommand; import org.junit.Assert; import org.junit.Test; diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTest.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTest.java index 8739c69..f53097c 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTest.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTest.java @@ -4,8 +4,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -18,8 +17,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AccountControllerIntegrationTestConfiguration.class) -@IntegrationTest +@SpringBootTest(classes = AccountControllerIntegrationTestConfiguration.class) @WebAppConfiguration public class AccountControllerIntegrationTest { diff --git a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTestConfiguration.java b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTestConfiguration.java index 4a9a313..b806a97 100644 --- a/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTestConfiguration.java +++ b/java-spring/accounts-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsservice/web/AccountControllerIntegrationTestConfiguration.java @@ -1,12 +1,13 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web; import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.AccountsConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({AccountsWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) +@Import({AccountsConfiguration.class, AccountsWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) @EnableAutoConfiguration public class AccountControllerIntegrationTestConfiguration { diff --git a/java-spring/accounts-view-service-api-web/build.gradle b/java-spring/accounts-view-service-api-web/build.gradle new file mode 100644 index 0000000..7e5f160 --- /dev/null +++ b/java-spring/accounts-view-service-api-web/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") +} diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountHistoryResponse.java b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/AccountHistoryResponse.java similarity index 75% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountHistoryResponse.java rename to java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/AccountHistoryResponse.java index ef629b6..e223168 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/AccountHistoryResponse.java +++ b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/AccountHistoryResponse.java @@ -1,4 +1,6 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi; + +import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountHistoryEntry; import java.util.List; diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountResponse.java b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountResponse.java similarity index 92% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountResponse.java rename to java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountResponse.java index 2c2c88d..0dbaf67 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountResponse.java +++ b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi; import java.math.BigDecimal; diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountsResponse.java b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountsResponse.java similarity index 83% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountsResponse.java rename to java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountsResponse.java index 93551ec..a771a14 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/accounts/GetAccountsResponse.java +++ b/java-spring/accounts-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accounts/view/webapi/GetAccountsResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.accounts; +package net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi; import java.util.List; diff --git a/java-spring/accounts-view-service/Dockerfile b/java-spring/accounts-view-service/Dockerfile index 30b248a..ad9b511 100644 --- a/java-spring/accounts-view-service/Dockerfile +++ b/java-spring/accounts-view-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar accounts-view-service.jar -EXPOSE 8080 -COPY build/libs/accounts-view-service.jar . +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/accounts-view-service.jar service.jar diff --git a/java-spring/accounts-view-service/build.gradle b/java-spring/accounts-view-service/build.gradle index 5e51216..bafc335 100644 --- a/java-spring/accounts-view-service/build.gradle +++ b/java-spring/accounts-view-service/build.gradle @@ -1,24 +1,25 @@ apply plugin: VerifyMongoDBConfigurationPlugin -apply plugin: VerifyEventStoreEnvironmentPlugin -apply plugin: EventuateDependencyPlugin -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' dependencies { compile project(":common-swagger") - compile project(":common-backend") + + compile project(":accounts-service-api-messaging") + compile project(":accounts-view-service-api-web") + + compile project(":transactions-service-api-messaging") + + compile "io.eventuate.local.java:eventuate-local-java-spring-jdbc:$eventuateLocalVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "org.springframework.boot:spring-boot-starter-hateoas:$springBootVersion" + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" testCompile project(":testutil") testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" -} - -test { - ignoreFailures System.getenv("EVENTUATE_API_KEY_ID") == null + testCompile "io.eventuate.local.java:eventuate-client-java-spring-jdbc:$eventuateLocalVersion" } diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountViewBackendConfiguration.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountViewConfiguration.java similarity index 66% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountViewBackendConfiguration.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountViewConfiguration.java index d6e7d32..280b27c 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountViewBackendConfiguration.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountViewConfiguration.java @@ -1,7 +1,12 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice; import io.eventuate.javaclient.spring.EnableEventHandlers; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfoRepository; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountInfoUpdateService; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountQueryService; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountQueryWorkflow; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.QuerySideDependencyChecker; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.core.MongoTemplate; @@ -10,7 +15,7 @@ @Configuration @EnableMongoRepositories @EnableEventHandlers -public class AccountViewBackendConfiguration { +public class AccountViewConfiguration { @Bean public AccountQueryWorkflow accountQueryWorkflow(AccountInfoUpdateService accountInfoUpdateService) { diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountsViewServiceMain.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountsViewServiceMain.java index 2913e76..d28dcab 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountsViewServiceMain.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/AccountsViewServiceMain.java @@ -1,8 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice; -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; +import io.eventuate.local.java.spring.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.web.AccountViewWebConfiguration; -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; @@ -10,7 +9,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({AccountViewWebConfiguration.class, EventuateDriverConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({AccountViewConfiguration.class, AccountViewWebConfiguration.class, EventuateDriverConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class AccountsViewServiceMain { diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfo.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfo.java similarity index 98% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfo.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfo.java index 6c71642..f3f7c21 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfo.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfo.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain; import com.fasterxml.jackson.annotation.JsonProperty; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo; diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoRepository.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfoRepository.java similarity index 66% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoRepository.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfoRepository.java index 7df97af..6965212 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoRepository.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountInfoRepository.java @@ -1,10 +1,10 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain; import org.springframework.data.mongodb.repository.MongoRepository; import java.util.List; -interface AccountInfoRepository extends MongoRepository { +public interface AccountInfoRepository extends MongoRepository { List findByCustomerId(String customerId); } diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountNotFoundException.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountNotFoundException.java similarity index 90% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountNotFoundException.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountNotFoundException.java index 7d6115b..2ac49d5 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountNotFoundException.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/AccountNotFoundException.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain; public class AccountNotFoundException extends RuntimeException { diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/QuerySideDependencyChecker.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/QuerySideDependencyChecker.java similarity index 91% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/QuerySideDependencyChecker.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/QuerySideDependencyChecker.java index 16c353b..3cd2f27 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/QuerySideDependencyChecker.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/domain/QuerySideDependencyChecker.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,7 +19,7 @@ public void checkDependencies() { try { logger.info("Checking mongodb connectivity {}", System.getenv("SPRING_DATA_MONGODB_URI")); - mongoTemplate.getDb().getCollectionNames(); + mongoTemplate.getCollectionNames(); } catch (Throwable e) { throw new RuntimeException("Error connecting to Mongo - have you set SPRING_DATA_MONGODB_URI or --spring.data.mongodb_uri?", e); diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoUpdateService.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountInfoUpdateService.java similarity index 82% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoUpdateService.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountInfoUpdateService.java index 21a91df..8932083 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountInfoUpdateService.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountInfoUpdateService.java @@ -1,7 +1,9 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service; -import com.mongodb.WriteResult; -import io.eventuate.Int128; +import com.mongodb.client.result.UpdateResult; +import io.eventuate.common.id.Int128; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfoRepository; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; @@ -15,7 +17,7 @@ import java.math.BigDecimal; import java.util.Date; -import static net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.MoneyUtil.toIntegerRepr; +import static net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.MoneyUtil.toIntegerRepr; import static org.springframework.data.mongodb.core.query.Criteria.where; public class AccountInfoUpdateService { @@ -34,7 +36,7 @@ public void create(String accountId, String customerId, String title, BigDecimal try { AccountChangeInfo ci = new AccountChangeInfo(); ci.setAmount(toIntegerRepr(initialBalance)); - WriteResult x = mongoTemplate.upsert(new Query(where("id").is(accountId).and("version").exists(false)), + UpdateResult x = mongoTemplate.upsert(new Query(where("id").is(accountId).and("version").exists(false)), new Update() .set("customerId", customerId) .set("title", title) @@ -55,7 +57,7 @@ public void create(String accountId, String customerId, String title, BigDecimal } public void delete(String accountId) { - accountInfoRepository.delete(accountId); + accountInfoRepository.deleteById(accountId); } @@ -68,7 +70,7 @@ public void addTransaction(String accountId, AccountTransactionInfo ti) { public void updateBalance(String accountId, String changeId, long balanceDelta, AccountChangeInfo ci) { - WriteResult x = mongoTemplate.updateMulti(new Query(where("id").is(accountId).and("version").lt(changeId)), + UpdateResult x = mongoTemplate.updateMulti(new Query(where("id").is(accountId).and("version").lt(changeId)), new Update(). inc("balance", balanceDelta). push("changes", ci). diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryService.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryService.java similarity index 52% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryService.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryService.java index 277ca8c..6a0820e 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryService.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryService.java @@ -1,4 +1,8 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service; + +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfoRepository; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountNotFoundException; import java.util.List; @@ -11,11 +15,7 @@ public AccountQueryService(AccountInfoRepository accountInfoRepository) { } public AccountInfo findByAccountId(String accountId) { - AccountInfo account = accountInfoRepository.findOne(accountId); - if (account == null) - throw new AccountNotFoundException(accountId); - else - return account; + return accountInfoRepository.findById(accountId).orElseThrow(() -> new AccountNotFoundException(accountId)); } public List findByCustomerId(String customerId) { diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryWorkflow.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryWorkflow.java similarity index 82% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryWorkflow.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryWorkflow.java index 5fc76de..d15d2e1 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/AccountQueryWorkflow.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/AccountQueryWorkflow.java @@ -1,23 +1,27 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service; import io.eventuate.DispatchedEvent; import io.eventuate.EventHandlerMethod; import io.eventuate.EventSubscriber; -import io.eventuate.Int128; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.*; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.CreditRecordedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.DebitRecordedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.FailedDebitRecordedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.MoneyTransferCreatedEvent; +import io.eventuate.common.id.Int128; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountChangedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountCreditedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDebitedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDeletedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountOpenedEvent; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.CreditRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.DebitRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.FailedDebitRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.MoneyTransferCreatedEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigDecimal; -import static net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.MoneyUtil.toIntegerRepr; +import static net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.MoneyUtil.toIntegerRepr; @EventSubscriber(id="querySideEventHandlers") public class AccountQueryWorkflow { diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/MoneyUtil.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/MoneyUtil.java similarity index 90% rename from java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/MoneyUtil.java rename to java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/MoneyUtil.java index 740aa76..f8fec14 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/backend/MoneyUtil.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/service/MoneyUtil.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service; import java.math.BigDecimal; diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountQueryController.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountQueryController.java index ef73230..93dfd93 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountQueryController.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountQueryController.java @@ -1,8 +1,11 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountNotFoundException; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountQueryService; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.AccountHistoryResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.GetAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.GetAccountsResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountNotFoundException; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountQueryService; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountViewWebConfiguration.java b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountViewWebConfiguration.java index 798e0e8..79a9c26 100644 --- a/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountViewWebConfiguration.java +++ b/java-spring/accounts-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/accountsviewservice/web/AccountViewWebConfiguration.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountViewBackendConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -10,7 +10,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({AccountViewBackendConfiguration.class}) +@Import(CommonSwaggerConfiguration.class) @ComponentScan public class AccountViewWebConfiguration { diff --git a/java-spring/accounts-view-service/src/main/resources/application.properties b/java-spring/accounts-view-service/src/main/resources/application.properties new file mode 100644 index 0000000..7c2c49c --- /dev/null +++ b/java-spring/accounts-view-service/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/eventuate +spring.datasource.username=mysqluser +spring.datasource.password=mysqlpw +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 diff --git a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountInfoUpdateServiceTest.java b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountInfoUpdateServiceTest.java index bca5a6d..d69f855 100644 --- a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountInfoUpdateServiceTest.java +++ b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountInfoUpdateServiceTest.java @@ -1,23 +1,23 @@ package net.chrisrichardson.eventstore.javaexamples.banking.web; -import io.eventuate.Int128; +import io.eventuate.common.id.IdGenerator; +import io.eventuate.common.id.IdGeneratorImpl; +import io.eventuate.common.id.Int128; import io.eventuate.javaclient.spring.jdbc.EventuateJdbcEventStoreConfiguration; -import io.eventuate.javaclient.spring.jdbc.IdGenerator; -import io.eventuate.javaclient.spring.jdbc.IdGeneratorImpl; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountInfoUpdateService; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountQueryService; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountViewBackendConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountCreditedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountCreditedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.domain.AccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountInfoUpdateService; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.service.AccountQueryService; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.AccountViewConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -29,13 +29,12 @@ import static org.junit.Assert.*; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AccountInfoUpdateServiceTest.AccountInfoUpdateServiceTestConfiguration.class) -@IntegrationTest +@SpringBootTest(classes = AccountInfoUpdateServiceTest.AccountInfoUpdateServiceTestConfiguration.class) public class AccountInfoUpdateServiceTest { @Configuration @EnableAutoConfiguration - @Import({AccountViewBackendConfiguration.class, EventuateJdbcEventStoreConfiguration.class}) + @Import({AccountViewConfiguration.class, EventuateJdbcEventStoreConfiguration.class, CommonSwaggerConfiguration.class}) public static class AccountInfoUpdateServiceTestConfiguration { } diff --git a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java index 663888e..a2474cd 100644 --- a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java +++ b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceIntegrationTest.java @@ -1,15 +1,13 @@ package net.chrisrichardson.eventstore.javaexamples.banking.web; -import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.GetAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.GetAccountResponse; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.client.RestTemplate; import java.math.BigDecimal; @@ -21,12 +19,10 @@ import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AccountsQuerySideServiceTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) +@SpringBootTest(classes = AccountsQuerySideServiceTestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class AccountsQuerySideServiceIntegrationTest { - @Value("${local.server.port}") + @LocalServerPort private int port; private String baseUrl(String path) { diff --git a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceTestConfiguration.java b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceTestConfiguration.java index b8a99e4..d134946 100644 --- a/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceTestConfiguration.java +++ b/java-spring/accounts-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/AccountsQuerySideServiceTestConfiguration.java @@ -1,10 +1,10 @@ package net.chrisrichardson.eventstore.javaexamples.banking.web; import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.AccountViewConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.web.AccountViewWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -17,7 +17,7 @@ import java.util.List; @Configuration -@Import({AccountViewWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({AccountViewConfiguration.class, AccountViewWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class AccountsQuerySideServiceTestConfiguration { diff --git a/java-spring/api-gateway-service-api-web/build.gradle b/java-spring/api-gateway-service-api-web/build.gradle new file mode 100644 index 0000000..7e5f160 --- /dev/null +++ b/java-spring/api-gateway-service-api-web/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") +} diff --git a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/AuthRequest.java b/java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/AuthRequest.java similarity index 88% rename from java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/AuthRequest.java rename to java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/AuthRequest.java index 262ac7c..0446cda 100644 --- a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/AuthRequest.java +++ b/java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/AuthRequest.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.commonauth.model; +package net.chrisrichardson.eventstore.javaexamples.banking.apigateway.webapi; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotBlank; diff --git a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/ErrorResponse.java b/java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/ErrorResponse.java similarity index 81% rename from java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/ErrorResponse.java rename to java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/ErrorResponse.java index 2aa5f1c..6fecf42 100644 --- a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/model/ErrorResponse.java +++ b/java-spring/api-gateway-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/webapi/ErrorResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.commonauth.model; +package net.chrisrichardson.eventstore.javaexamples.banking.apigateway.webapi; /** * Created by Main on 17.02.2016. diff --git a/java-spring/api-gateway-service/Dockerfile b/java-spring/api-gateway-service/Dockerfile index 21de9fd..9cdcbe6 100644 --- a/java-spring/api-gateway-service/Dockerfile +++ b/java-spring/api-gateway-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar api-gateway-service.jar -EXPOSE 8080 -COPY build/libs/api-gateway-service.jar . +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/api-gateway-service.jar service.jar diff --git a/java-spring/api-gateway-service/build.gradle b/java-spring/api-gateway-service/build.gradle index ae92d18..d9849ce 100644 --- a/java-spring/api-gateway-service/build.gradle +++ b/java-spring/api-gateway-service/build.gradle @@ -1,8 +1,10 @@ apply plugin: 'java' -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' dependencies { - compile project(":common-auth-web") + compile project(":common-auth") + + compile project(":api-gateway-service-api-web") compile "org.apache.httpcomponents:httpclient:4.5" compile "org.apache.httpcomponents:fluent-hc:4.5.1" @@ -11,6 +13,7 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" testCompile "junit:junit:4.11" + testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" } task copyWebStatic(type: Copy) { @@ -18,4 +21,4 @@ task copyWebStatic(type: Copy) { into "build/resources/main/static" } -jar.dependsOn(copyWebStatic) \ No newline at end of file +bootJar.dependsOn(copyWebStatic) \ No newline at end of file diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/ApiGatewayServiceConfiguration.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/ApiGatewayServiceConfiguration.java index e59c91c..97bf8c5 100755 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/ApiGatewayServiceConfiguration.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/ApiGatewayServiceConfiguration.java @@ -1,11 +1,11 @@ package net.chrisrichardson.eventstore.javaexamples.banking.apigateway; import com.fasterxml.jackson.databind.ObjectMapper; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfigurationAdapter; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -23,7 +23,7 @@ @Configuration @ComponentScan @EnableAutoConfiguration -@Import({AuthConfiguration.class}) +@Import({AuthConfigurationAdapter.class}) @EnableConfigurationProperties({ApiGatewayProperties.class}) public class ApiGatewayServiceConfiguration extends WebMvcConfigurerAdapter { diff --git a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/AuthController.java similarity index 79% rename from java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java rename to java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/AuthController.java index 732651b..874a7b3 100644 --- a/java-spring/common-auth-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthController.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/AuthController.java @@ -1,11 +1,11 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.commonauth.controller; +package net.chrisrichardson.eventstore.javaexamples.banking.apigateway.controller; import com.fasterxml.jackson.databind.ObjectMapper; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.UserCredentials; import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.CustomerAuthService; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.model.ErrorResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.apigateway.webapi.ErrorResponse; import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.model.User; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.IncorrectResultSizeDataAccessException; @@ -38,8 +38,8 @@ public class AuthController { private static ObjectMapper objectMapper = new ObjectMapper(); @RequestMapping(value = "/login", method = POST) - public ResponseEntity doAuth(@RequestBody @Valid UserCredentials request) throws IOException { - QuerySideCustomer customer = customerAuthService.findByEmailAndPassword(request.getEmail(), request.getPassword()); + public ResponseEntity doAuth(@RequestBody @Valid UserCredentials request) throws IOException { + CustomerView customer = customerAuthService.findByEmailAndPassword(request.getEmail(), request.getPassword()); Token token = tokenService.allocateToken(objectMapper.writeValueAsString(new User(request.getEmail()))); return ResponseEntity.status(HttpStatus.OK).header("access-token", token.getKey()) @@ -53,7 +53,7 @@ public ErrorResponse customersNotFound() { } @RequestMapping(value = "/user", method = GET) - public ResponseEntity getCurrentUser() { + public ResponseEntity getCurrentUser() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); return ResponseEntity.status(HttpStatus.OK).body(customerAuthService.findByEmail(auth.getName())); diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java index 71b9e51..993205a 100755 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/controller/GatewayController.java @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; +import org.springframework.web.servlet.NoHandlerFoundException; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; @@ -53,7 +53,7 @@ public void init() { @RequestMapping(value = "/api/**", method = {GET, POST, DELETE}) @ResponseBody - public ResponseEntity proxyRequest(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, IOException, URISyntaxException { + public ResponseEntity proxyRequest(HttpServletRequest request) throws NoHandlerFoundException, IOException, URISyntaxException { HttpUriRequest proxiedRequest = createHttpUriRequest(request); logger.info("request: {}", proxiedRequest); HttpResponse proxiedResponse = httpClient.execute(proxiedRequest); @@ -68,7 +68,7 @@ private HttpHeaders makeResponseHeaders(HttpResponse response) { return result; } - private HttpUriRequest createHttpUriRequest(HttpServletRequest request) throws URISyntaxException, NoSuchRequestHandlingMethodException, IOException { + private HttpUriRequest createHttpUriRequest(HttpServletRequest request) throws URISyntaxException, NoHandlerFoundException, IOException { URLRequestTransformer urlRequestTransformer = new URLRequestTransformer(apiGatewayProperties); ContentRequestTransformer contentRequestTransformer = new ContentRequestTransformer(); HeadersRequestTransformer headersRequestTransformer = new HeadersRequestTransformer(); diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ContentRequestTransformer.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ContentRequestTransformer.java index afdd433..b4a519b 100644 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ContentRequestTransformer.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ContentRequestTransformer.java @@ -3,7 +3,7 @@ import org.apache.http.client.methods.RequestBuilder; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; +import org.springframework.web.servlet.NoHandlerFoundException; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @@ -13,7 +13,7 @@ public class ContentRequestTransformer extends ProxyRequestTransformer { @Override - public RequestBuilder transform(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, URISyntaxException, IOException { + public RequestBuilder transform(HttpServletRequest request) throws NoHandlerFoundException, URISyntaxException, IOException { RequestBuilder requestBuilder = predecessor.transform(request); String requestContent = request.getReader().lines().collect(Collectors.joining("")); diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/HeadersRequestTransformer.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/HeadersRequestTransformer.java index c3c8bbb..bf8d2a9 100644 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/HeadersRequestTransformer.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/HeadersRequestTransformer.java @@ -1,8 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.apigateway.utils; import org.apache.http.client.methods.RequestBuilder; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; - +import org.springframework.web.servlet.NoHandlerFoundException; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.net.URISyntaxException; @@ -11,7 +10,7 @@ public class HeadersRequestTransformer extends ProxyRequestTransformer { @Override - public RequestBuilder transform(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, URISyntaxException, IOException { + public RequestBuilder transform(HttpServletRequest request) throws NoHandlerFoundException, URISyntaxException, IOException { RequestBuilder requestBuilder = predecessor.transform(request); Enumeration headerNames = request.getHeaderNames(); diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ProxyRequestTransformer.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ProxyRequestTransformer.java index 57406c0..5126041 100644 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ProxyRequestTransformer.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/ProxyRequestTransformer.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.apigateway.utils; import org.apache.http.client.methods.RequestBuilder; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; +import org.springframework.web.servlet.NoHandlerFoundException; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @@ -11,7 +11,7 @@ public abstract class ProxyRequestTransformer { protected ProxyRequestTransformer predecessor; - public abstract RequestBuilder transform(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, URISyntaxException, IOException; + public abstract RequestBuilder transform(HttpServletRequest request) throws NoHandlerFoundException, URISyntaxException, IOException; public void setPredecessor(ProxyRequestTransformer transformer) { this.predecessor = transformer; diff --git a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/URLRequestTransformer.java b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/URLRequestTransformer.java index 60ee208..888d912 100644 --- a/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/URLRequestTransformer.java +++ b/java-spring/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/utils/URLRequestTransformer.java @@ -2,8 +2,9 @@ import net.chrisrichardson.eventstore.javaexamples.banking.apigateway.ApiGatewayProperties; import org.apache.http.client.methods.RequestBuilder; +import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; +import org.springframework.web.servlet.NoHandlerFoundException; import javax.servlet.http.HttpServletRequest; import java.net.URI; @@ -18,7 +19,7 @@ public URLRequestTransformer(ApiGatewayProperties apiGatewayProperties) { } @Override - public RequestBuilder transform(HttpServletRequest request) throws NoSuchRequestHandlingMethodException, URISyntaxException { + public RequestBuilder transform(HttpServletRequest request) throws NoHandlerFoundException, URISyntaxException { String requestURI = request.getRequestURI(); URI uri; if (request.getQueryString() != null && !request.getQueryString().isEmpty()) { @@ -32,14 +33,15 @@ public RequestBuilder transform(HttpServletRequest request) throws NoSuchRequest return rb; } - private String getServiceUrl(String requestURI, HttpServletRequest httpServletRequest) throws NoSuchRequestHandlingMethodException { + private String getServiceUrl(String requestURI, HttpServletRequest httpServletRequest) throws NoHandlerFoundException { ApiGatewayProperties.Endpoint endpoint = apiGatewayProperties.getEndpoints().stream() .filter(e -> requestURI.matches(e.getPath()) && e.getMethod() == RequestMethod.valueOf(httpServletRequest.getMethod()) ) - .findFirst().orElseThrow(() -> new NoSuchRequestHandlingMethodException(httpServletRequest)); + .findFirst().orElseThrow(() -> new NoHandlerFoundException(httpServletRequest.getMethod(), + httpServletRequest.getRequestURL().toString(), new HttpHeaders())); return endpoint.getLocation() + requestURI; } } diff --git a/java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTest.java b/java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTest.java similarity index 84% rename from java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTest.java rename to java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTest.java index 8fb03c7..fba955d 100644 --- a/java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTest.java +++ b/java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTest.java @@ -1,19 +1,19 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.commonauth.controller; +package net.chrisrichardson.eventstore.javaexamples.banking.apigateway; import com.fasterxml.jackson.databind.ObjectMapper; +import net.chrisrichardson.eventstore.javaexamples.banking.apigateway.controller.AuthController; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Address; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Name; import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.CustomerAuthService; import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.model.User; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.http.MediaType; import org.springframework.security.core.token.DefaultToken; @@ -29,8 +29,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AuthControllerIntegrationTestConfiguration.class) -@IntegrationTest +@SpringBootTest(classes = AuthControllerIntegrationTestConfiguration.class) @WebAppConfiguration public class AuthControllerIntegrationTest { @@ -55,7 +54,7 @@ public void setup() { @Test public void shouldLogin() throws Exception { - when(customerAuthService.findByEmailAndPassword("my@email.com", "my_password")).thenReturn(new QuerySideCustomer("id", new Name("test", "test"), "my@email.com", "my_password", "ssn", "", new Address(), null)); + when(customerAuthService.findByEmailAndPassword("my@email.com", "my_password")).thenReturn(new CustomerView("id", new Name("test", "test"), "my@email.com", "my_password", "ssn", "", new Address(), null)); when(customerAuthService.findByEmailAndPassword("not_my@email.com", "not_my_password")).thenThrow(new EmptyResultDataAccessException(1)); when(tokenService.allocateToken(om.writeValueAsString(new User("my@email.com")))).thenReturn(new DefaultToken("key", System.currentTimeMillis(), "")); diff --git a/java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTestConfiguration.java b/java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTestConfiguration.java similarity index 70% rename from java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTestConfiguration.java rename to java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTestConfiguration.java index 95d484b..5f8cff5 100644 --- a/java-spring/common-auth-web/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/controller/AuthControllerIntegrationTestConfiguration.java +++ b/java-spring/api-gateway-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/apigateway/AuthControllerIntegrationTestConfiguration.java @@ -1,12 +1,12 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.commonauth.controller; +package net.chrisrichardson.eventstore.javaexamples.banking.apigateway; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfigurationAdapter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import(AuthConfiguration.class) +@Import(AuthConfigurationAdapter.class) @EnableAutoConfiguration public class AuthControllerIntegrationTestConfiguration { } diff --git a/java-spring/backend-integration-tests/build.gradle b/java-spring/backend-integration-tests/build.gradle deleted file mode 100644 index 6cc950a..0000000 --- a/java-spring/backend-integration-tests/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -apply plugin: VerifyMongoDBConfigurationPlugin - -dependencies { - - testCompile project(":transactions-service") - testCompile project(":accounts-service") - testCompile project(":accounts-view-service") - testCompile project(":customers-service") - testCompile project(":customers-view-service") - testCompile project(":testutil") - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" - -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/BankingTestConfiguration.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/BankingTestConfiguration.java deleted file mode 100644 index 3267ff2..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/BankingTestConfiguration.java +++ /dev/null @@ -1,15 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend; - -import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountsBackendConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferBackendConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - -@Configuration -@Import({AccountsBackendConfiguration.class, MoneyTransferBackendConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) -@EnableAutoConfiguration -public class BankingTestConfiguration { - -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/MoneyTransferIntegrationTest.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/MoneyTransferIntegrationTest.java deleted file mode 100644 index 515a394..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/MoneyTransferIntegrationTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend; - -import io.eventuate.EntityWithIdAndVersion; -import io.eventuate.EventuateAggregateStore; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.Account; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountService; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.TransferDetails; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransfer; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferService; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.math.BigDecimal; - -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.await; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually; - - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = BankingTestConfiguration.class) -@IntegrationTest -public class MoneyTransferIntegrationTest { - - @Autowired - private AccountService accountService; - - @Autowired - private MoneyTransferService moneyTransferService; - - @Autowired - private EventuateAggregateStore eventStore; - - - @Test - public void shouldTransferMoney() { - final EntityWithIdAndVersion fromAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(150), "")); - - final EntityWithIdAndVersion toAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(300), "")); - - final EntityWithIdAndVersion transaction = await( - moneyTransferService.transferMoney(new TransferDetails(fromAccount.getEntityId(), - toAccount.getEntityId(), - new BigDecimal(80)))); - - - eventually( - () -> eventStore.find(Account.class, fromAccount.getEntityId()), - account -> Assert.assertEquals(new BigDecimal(70), account.getEntity().getBalance())); - - eventually( - () -> eventStore.find(Account.class, toAccount.getEntityId()), - account -> Assert.assertEquals(new BigDecimal(380), account.getEntity().getBalance())); - - eventually( - () -> eventStore.find(MoneyTransfer.class, transaction.getEntityId()), - updatedTransaction -> Assert.assertEquals(TransferState.COMPLETED, updatedTransaction.getEntity().getState())); - } - - @Test - public void shouldFailDueToInsufficientFunds() { - final EntityWithIdAndVersion fromAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(150), "")); - - final EntityWithIdAndVersion toAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(300), "")); - - final EntityWithIdAndVersion transaction = await( - moneyTransferService.transferMoney(new TransferDetails(fromAccount.getEntityId(), - toAccount.getEntityId(), - new BigDecimal(200)))); - - - eventually( - () -> eventStore.find(MoneyTransfer.class, transaction.getEntityId()), - updatedTransaction -> Assert.assertEquals(TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS, updatedTransaction.getEntity().getState())); - - eventually( - () -> eventStore.find(Account.class, fromAccount.getEntityId()), - account -> Assert.assertEquals(new BigDecimal(150), account.getEntity().getBalance())); - - eventually( - () -> eventStore.find(Account.class, toAccount.getEntityId()), - account -> Assert.assertEquals(new BigDecimal(300), account.getEntity().getBalance())); - - } - - -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideIntegrationTest.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideIntegrationTest.java deleted file mode 100644 index 00ac5d8..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideIntegrationTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts; - -import io.eventuate.EntityWithIdAndVersion; -import io.eventuate.EventuateAggregateStore; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.Account; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountService; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountQueryService; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.TransferDetails; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransfer; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferService; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.math.BigDecimal; -import java.util.concurrent.CompletableFuture; - -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.await; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = AccountQuerySideTestConfiguration.class) -@IntegrationTest -public class AccountQuerySideIntegrationTest { - - @Autowired - private AccountService accountService; - - @Autowired - private MoneyTransferService moneyTransferService; - - @Autowired - private EventuateAggregateStore eventStore; - - @Autowired - private AccountQueryService accountQueryService; - - @Test - public void shouldUpdateQuerySide() throws Exception { - - final EntityWithIdAndVersion fromAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(150), "")); - - final EntityWithIdAndVersion toAccount = await(accountService.openAccount("00000000-00000000", "My Account", new BigDecimal(300), "")); - - final EntityWithIdAndVersion transaction = await( - moneyTransferService.transferMoney(new TransferDetails(fromAccount.getEntityId(), - toAccount.getEntityId(), - new BigDecimal(80)))); - - eventually( - () -> eventStore.find(MoneyTransfer.class, transaction.getEntityId()), - updatedTransaction -> Assert.assertEquals(TransferState.COMPLETED, updatedTransaction.getEntity().getState())); - - eventually( - () -> CompletableFuture.completedFuture(accountQueryService.findByAccountId(fromAccount.getEntityId())), - accountInfo -> Assert.assertEquals(70 * 100, accountInfo.getBalance())); - eventually( - () -> CompletableFuture.completedFuture(accountQueryService.findByAccountId(toAccount.getEntityId())), - accountInfo -> Assert.assertEquals(380 * 100, accountInfo.getBalance())); - } -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideTestConfiguration.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideTestConfiguration.java deleted file mode 100644 index 5e57b90..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQuerySideTestConfiguration.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts; - -import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.backend.AccountsBackendConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.backend.AccountViewBackendConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferBackendConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - -@Configuration -@Import({AccountsBackendConfiguration.class, MoneyTransferBackendConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class, - AccountViewBackendConfiguration.class}) -@EnableAutoConfiguration -public class AccountQuerySideTestConfiguration { -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideIntegrationTest.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideIntegrationTest.java deleted file mode 100644 index 33477a1..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideIntegrationTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.customers; - -import io.eventuate.EntityWithIdAndVersion; -import io.eventuate.EventuateAggregateStore; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.Customer; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.CustomerService; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend.CustomerQueryService; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; -import net.chrisrichardson.eventstorestore.javaexamples.testutil.Producer; -import net.chrisrichardson.eventstorestore.javaexamples.testutil.Verifier; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.concurrent.CompletableFuture; - -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils.generateCustomerInfo; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils.generateToAccountInfo; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.await; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually; - -/** - * Created by Main on 10.02.2016. - */ -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = CustomerQuerySideTestConfiguration.class) -@IntegrationTest -public class CustomerQuerySideIntegrationTest { - - @Autowired - private CustomerService customerService; - - @Autowired - private CustomerQueryService customerQueryService; - - @Autowired - private EventuateAggregateStore eventStore; - - @Test - public void shouldCreateCustomerAndAddToAccount() throws Exception { - CustomerInfo customerInfo = generateCustomerInfo(); - EntityWithIdAndVersion customer = await(customerService.createCustomer(customerInfo)); - - ToAccountInfo toAccountInfo = generateToAccountInfo(); - EntityWithIdAndVersion customerWithNewAccount = await(customerService.addToAccount(customer.getEntityId(), toAccountInfo)); - - eventually( - new Producer() { - @Override - public CompletableFuture produce() { - return customerQueryService.findByCustomerId(customer.getEntityId()); - } - }, - new Verifier() { - @Override - public void verify(QuerySideCustomer querySideCustomer) { - Assert.assertEquals(customerInfo.getName(), querySideCustomer.getName()); - Assert.assertEquals(customerInfo.getSsn(), querySideCustomer.getSsn()); - Assert.assertEquals(customerInfo.getUserCredentials().getEmail(), querySideCustomer.getEmail()); - Assert.assertEquals(customerInfo.getPhoneNumber(), querySideCustomer.getPhoneNumber()); - Assert.assertEquals(customerInfo.getAddress(), querySideCustomer.getAddress()); - - Assert.assertNotNull(querySideCustomer.getToAccounts()); - Assert.assertFalse(querySideCustomer.getToAccounts().isEmpty()); - Assert.assertEquals(querySideCustomer.getToAccounts().get("11111111-11111111"), toAccountInfo); - } - }); - } -} diff --git a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideTestConfiguration.java b/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideTestConfiguration.java deleted file mode 100644 index dbe31ce..0000000 --- a/java-spring/backend-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/customers/CustomerQuerySideTestConfiguration.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.customers; - -import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.CustomerBackendConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend.CustomerViewBackendConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - -@Configuration -@Import({CustomerBackendConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class, CustomerViewBackendConfiguration.class}) -@EnableAutoConfiguration -public class CustomerQuerySideTestConfiguration { -} diff --git a/java-spring/build-and-test-all-eventuate-local.sh b/java-spring/build-and-test-all-eventuate-local.sh deleted file mode 100755 index d5c1dc1..0000000 --- a/java-spring/build-and-test-all-eventuate-local.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -export JAVA_OPTS="-Xmx128m -Xms128m" -export EXTRA_INFRASTRUCTURE_SERVICES=cdcservice -export EVENTUATE_LOCAL=yes -../_build-and-test-all.sh -f docker-compose-eventuate-local.yml $* -P eventuateDriver=local diff --git a/java-spring/build-and-test-all.sh b/java-spring/build-and-test-all.sh index e123e57..17138d1 100755 --- a/java-spring/build-and-test-all.sh +++ b/java-spring/build-and-test-all.sh @@ -1,4 +1,54 @@ #! /bin/bash -export JAVA_OPTS="-Xmx128m -Xms128m" -../_build-and-test-all.sh $* +set -e + +if [ -z "$DOCKER_HOST_IP" ] ; then + if [ -z "$DOCKER_HOST" ] ; then + export DOCKER_HOST_IP=`hostname` + else + echo using ${DOCKER_HOST?} + XX=${DOCKER_HOST%\:*} + export DOCKER_HOST_IP=${XX#tcp\:\/\/} + fi + echo set DOCKER_HOST_IP $DOCKER_HOST_IP +fi + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +dockerall="./gradlew mysqlbinlogCompose" +dockerinfrastructure="./gradlew mysqlbinloginfrastructureCompose" + +if [ "$1" = "--use-existing" ] ; then + shift; +else + ${dockerall}Down +fi + +NO_RM=false + +if [ "$1" = "--no-rm" ] ; then + NO_RM=true + shift +fi + +${dockerinfrastructure}Up + + +if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then + export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP?}/mydb + echo Set SPRING_DATA_MONGODB_URI $SPRING_DATA_MONGODB_URI +fi + +export SERVICE_HOST=$DOCKER_HOST_IP + +./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS $* build -x :e2e-test:test + +${dockerall}Up + +set -e + +./gradlew $BUILD_AND_TEST_ALL_EXTRA_GRADLE_ARGS -a $* :e2e-test:cleanTest :e2e-test:test -P ignoreE2EFailures=false + +if [ $NO_RM = false ] ; then + ${dockerall}Down +fi diff --git a/java-spring/build.gradle b/java-spring/build.gradle index 611d01c..15898cd 100644 --- a/java-spring/build.gradle +++ b/java-spring/build.gradle @@ -1,21 +1,22 @@ buildscript { repositories { mavenCentral() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion") + classpath "com.avast.gradle:gradle-docker-compose-plugin:$dockerComposePluginVersion" } } +apply plugin: 'docker-compose' + allprojects { group = "net.chrisrichardson.eventstore" } - -task wrapper(type: Wrapper) { - gradleVersion = '2.0' -} - subprojects { apply plugin: 'java' sourceCompatibility = 1.8 @@ -27,3 +28,23 @@ subprojects { eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } } } } + +dockerCompose { + environment.put "EVENTUATE_COMMON_VERSION", eventuateCommonImageVersion + environment.put "EVENTUATE_CDC_VERSION", eventuateCdcImageVersion + environment.put "EVENTUATE_JAVA_BASE_IMAGE_VERSION", eventuateExamplesBaseImageVersion + + removeOrphans = true + + mysqlbinlog { + projectName = null + removeContainers = project.ext.removeContainers + } + + mysqlbinloginfrastructure { + projectName = null + startedServices = ["cdc-service", "mongodb"] + removeContainers = project.ext.removeContainers + } + +} diff --git a/java-spring/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy b/java-spring/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy deleted file mode 100644 index 308e417..0000000 --- a/java-spring/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy +++ /dev/null @@ -1,16 +0,0 @@ -import org.gradle.api.Plugin -import org.gradle.api.Project - -class EventuateDependencyPlugin implements Plugin { - - @Override - void apply(Project project) { - project.dependencies { - if (project.hasProperty("eventuateDriver") && project.property("eventuateDriver").equals("local")) { - compile "io.eventuate.local.java:eventuate-local-java-jdbc:${project.eventuateLocalVersion}" - compile "io.eventuate.local.java:eventuate-local-java-embedded-cdc-autoconfigure:${project.eventuateLocalVersion}" - } else - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:${project.eventuateClientVersion}" - } - } -} diff --git a/java-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy b/java-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy deleted file mode 100644 index dcdba2c..0000000 --- a/java-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy +++ /dev/null @@ -1,15 +0,0 @@ -import org.gradle.api.* - - -class VerifyEventStoreEnvironmentPlugin implements Plugin { - void apply(Project project) { - project.test { - beforeSuite { x -> - if (x.parent == null) { - if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null) - logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n") - } - } - } - } -} diff --git a/java-spring/common-auth-web/build.gradle b/java-spring/common-auth-web/build.gradle deleted file mode 100644 index 4a622c4..0000000 --- a/java-spring/common-auth-web/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -apply plugin: 'java' - -dependencies { - compile project(":common-auth") - compile project(":common") - - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-security:$springBootVersion" - - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" -} diff --git a/java-spring/common-auth/build.gradle b/java-spring/common-auth/build.gradle index 15a7af4..f741f34 100644 --- a/java-spring/common-auth/build.gradle +++ b/java-spring/common-auth/build.gradle @@ -2,14 +2,12 @@ apply plugin: 'java' dependencies { compile project(":common") - compile project(":customers-query-side-common") + compile project(":customers-view-service-api-common") compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" - compile "org.springframework.security:spring-security-config:4.0.2.RELEASE" - compile "org.springframework.security:spring-security-web:4.0.2.RELEASE" - + compile "org.springframework.boot:spring-boot-starter-security:$springBootVersion" testCompile "junit:junit:4.11" } \ No newline at end of file diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java index 737bd46..3f7b3bd 100755 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java @@ -1,25 +1,13 @@ package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.filter.StatelessAuthenticationFilter; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -import org.springframework.http.HttpMethod; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.token.KeyBasedPersistenceTokenService; import org.springframework.security.core.token.TokenService; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; import java.security.SecureRandom; @@ -27,31 +15,8 @@ @ComponentScan @EnableWebSecurity @EnableMongoRepositories -@EnableConfigurationProperties({AuthProperties.class}) -public class AuthConfiguration extends WebSecurityConfigurerAdapter { - - @Autowired - private AuthProperties securityProperties; - - @Autowired - private TokenAuthenticationService tokenAuthenticationService; - - @Autowired - CustomerAuthService customerAuthService; - - @Override - protected void configure(AuthenticationManagerBuilder auth) throws Exception { - auth.userDetailsService(userDetailsServiceBean()); - } - - @Override - public UserDetailsService userDetailsServiceBean() { - return email -> { - QuerySideCustomer customer = customerAuthService.findByEmail(email); - return new User(email, customer.getPassword(), true, true, true, true, - AuthorityUtils.createAuthorityList("USER")); - }; - } +@Import(AuthPropertiesConfiguration.class) +public class AuthConfiguration { @Bean public CustomerAuthService customerAuthService(CustomerAuthRepository customerAuthRepository) { @@ -59,28 +24,7 @@ public CustomerAuthService customerAuthService(CustomerAuthRepository customerAu } @Bean - @Override - public AuthenticationManager authenticationManagerBean() throws Exception { - return super.authenticationManagerBean(); - } - - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .csrf() - .disable() - .httpBasic() - .and() - .authorizeRequests() - .antMatchers(HttpMethod.POST, "/api/customers", "/api/login").permitAll() - .antMatchers("/api/**").permitAll() - .anyRequest().permitAll() - .and() - .addFilterAfter(new StatelessAuthenticationFilter(tokenAuthenticationService), BasicAuthenticationFilter.class); - } - - @Bean - public TokenService tokenService() { + public TokenService tokenService(AuthProperties securityProperties) { KeyBasedPersistenceTokenService res = new KeyBasedPersistenceTokenService(); res.setSecureRandom(new SecureRandom()); res.setServerSecret(securityProperties.getServerSecret()); diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfigurationAdapter.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfigurationAdapter.java new file mode 100755 index 0000000..ff58305 --- /dev/null +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfigurationAdapter.java @@ -0,0 +1,63 @@ +package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; + +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; +import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.filter.StatelessAuthenticationFilter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.authority.AuthorityUtils; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + +@Configuration +@Import(AuthConfiguration.class) +public class AuthConfigurationAdapter extends WebSecurityConfigurerAdapter { + + @Autowired + private TokenAuthenticationService tokenAuthenticationService; + + @Autowired + private CustomerAuthService customerAuthService; + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(userDetailsServiceBean()); + } + + @Override + public UserDetailsService userDetailsServiceBean() { + return email -> { + CustomerView customer = customerAuthService.findByEmail(email); + return new User(email, "{noop}" + customer.getPassword(), true, true, true, true, + AuthorityUtils.createAuthorityList("USER")); + }; + } + + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .csrf() + .disable() + .httpBasic() + .and() + .authorizeRequests() + .antMatchers(HttpMethod.POST, "/api/customers", "/api/login").permitAll() + .antMatchers("/api/**").permitAll() + .anyRequest().permitAll() + .and() + .addFilterAfter(new StatelessAuthenticationFilter(tokenAuthenticationService), BasicAuthenticationFilter.class); + } +} diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthProperties.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthProperties.java index 7f47e10..3fcf671 100755 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthProperties.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthProperties.java @@ -1,10 +1,14 @@ package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; -@ConfigurationProperties(locations = "classpath:auth.properties", ignoreUnknownFields = false, prefix = "auth") public class AuthProperties { + @Value("${auth.server.secret}") private String serverSecret; + + @Value("${auth.server.integer}") private Integer serverInteger; public String getServerSecret() { diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthPropertiesConfiguration.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthPropertiesConfiguration.java new file mode 100755 index 0000000..5a65515 --- /dev/null +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthPropertiesConfiguration.java @@ -0,0 +1,14 @@ +package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@PropertySource(value="classpath:auth.properties") +public class AuthPropertiesConfiguration { + @Bean + public AuthProperties authProperties() { + return new AuthProperties(); + } +} diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthRepository.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthRepository.java index 0a83b75..3ecf1e1 100644 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthRepository.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthRepository.java @@ -1,13 +1,13 @@ package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.springframework.data.mongodb.repository.MongoRepository; import java.util.List; -interface CustomerAuthRepository extends MongoRepository { +interface CustomerAuthRepository extends MongoRepository { - List findByEmail(String email); + List findByEmail(String email); - List findByEmailAndPassword(String email, String password); + List findByEmailAndPassword(String email, String password); } \ No newline at end of file diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthService.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthService.java index 96f5eff..0b127fa 100644 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthService.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/CustomerAuthService.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.javaexamples.banking.commonauth; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.support.DataAccessUtils; @@ -14,16 +14,16 @@ public CustomerAuthService(CustomerAuthRepository customerAuthRepository) { this.customerAuthRepository = customerAuthRepository; } - public QuerySideCustomer findByEmail(String email) { - QuerySideCustomer result = DataAccessUtils.uniqueResult(customerAuthRepository.findByEmail(email)); + public CustomerView findByEmail(String email) { + CustomerView result = DataAccessUtils.uniqueResult(customerAuthRepository.findByEmail(email)); if (result==null) throw new EmptyResultDataAccessException(1); return result; } - public QuerySideCustomer findByEmailAndPassword(String email, String password) { - QuerySideCustomer result = DataAccessUtils.uniqueResult(customerAuthRepository.findByEmailAndPassword(email, password)); + public CustomerView findByEmailAndPassword(String email, String password) { + CustomerView result = DataAccessUtils.uniqueResult(customerAuthRepository.findByEmailAndPassword(email, password)); if (result==null) throw new EmptyResultDataAccessException(1); diff --git a/java-spring/common-auth/src/main/resources/auth.properties b/java-spring/common-auth/src/main/resources/auth.properties index f3bfa4a..c3ec92e 100644 --- a/java-spring/common-auth/src/main/resources/auth.properties +++ b/java-spring/common-auth/src/main/resources/auth.properties @@ -1,2 +1,2 @@ -auth.serverSecret=the_cake_is_a_lie -auth.serverInteger=1 \ No newline at end of file +auth.server.secret=the_cake_is_a_lie +auth.server.integer=1 \ No newline at end of file diff --git a/java-spring/common-backend/build.gradle b/java-spring/common-backend/build.gradle deleted file mode 100644 index b0df157..0000000 --- a/java-spring/common-backend/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -apply plugin: 'java' - -dependencies { - compile project(":common") - - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" - - -} diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDeletedEvent.java b/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDeletedEvent.java deleted file mode 100644 index 61240a1..0000000 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/accounts/AccountDeletedEvent.java +++ /dev/null @@ -1,4 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts; - -public class AccountDeletedEvent extends AccountEvent { -} diff --git a/java-spring/common-backend/src/main/resources/logback.xml b/java-spring/common-backend/src/main/resources/logback.xml deleted file mode 100644 index 654ade8..0000000 --- a/java-spring/common-backend/src/main/resources/logback.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - diff --git a/java-spring/common-swagger/build.gradle b/java-spring/common-swagger/build.gradle index b72a5d1..2675eb2 100644 --- a/java-spring/common-swagger/build.gradle +++ b/java-spring/common-swagger/build.gradle @@ -1,7 +1,5 @@ dependencies { - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - - compile "io.springfox:springfox-swagger2:2.2.2" - compile 'io.springfox:springfox-swagger-ui:2.2.2' + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" + compile "io.eventuate.util:eventuate-util-spring-swagger:$eventuateUtilVersion" } \ No newline at end of file diff --git a/java-spring/common-swagger/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonswagger/CommonSwaggerConfiguration.java b/java-spring/common-swagger/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonswagger/CommonSwaggerConfiguration.java index b1cbd55..6956821 100644 --- a/java-spring/common-swagger/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonswagger/CommonSwaggerConfiguration.java +++ b/java-spring/common-swagger/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonswagger/CommonSwaggerConfiguration.java @@ -1,43 +1,16 @@ package net.chrisrichardson.eventstore.javaexamples.banking.commonswagger; -import com.fasterxml.classmate.TypeResolver; -import org.springframework.beans.factory.annotation.Autowired; +import io.eventuate.util.spring.swagger.EventuateSwaggerConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.async.DeferredResult; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.schema.WildcardType; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; -import java.util.concurrent.CompletableFuture; - -import static springfox.documentation.schema.AlternateTypeRules.newRule; - @Configuration @EnableSwagger2 public class CommonSwaggerConfiguration { @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("net.chrisrichardson.eventstore.javaexamples.banking")) - .build() - .pathMapping("/") - .genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class) - .alternateTypeRules( - newRule(typeResolver.resolve(DeferredResult.class, - typeResolver.resolve(ResponseEntity.class, WildcardType.class)), - typeResolver.resolve(WildcardType.class)) - ) - .useDefaultResponseMessages(false) - ; + public EventuateSwaggerConfig eventuateSwaggerConfig() { + return () -> "net.chrisrichardson.eventstore.javaexamples.banking"; } - - @Autowired - private TypeResolver typeResolver; - } diff --git a/java-spring/customers-service-api-messaging/build.gradle b/java-spring/customers-service-api-messaging/build.gradle new file mode 100644 index 0000000..3e5f28d --- /dev/null +++ b/java-spring/customers-service-api-messaging/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") + + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" +} diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerAddedToAccount.java b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerAddedToAccount.java similarity index 86% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerAddedToAccount.java rename to java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerAddedToAccount.java index ea47143..f499fc9 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerAddedToAccount.java +++ b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerAddedToAccount.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerCreatedEvent.java b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerCreatedEvent.java similarity index 85% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerCreatedEvent.java rename to java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerCreatedEvent.java index 31bc3b5..f2dfdaa 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerCreatedEvent.java +++ b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerCreatedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerEvent.java b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerEvent.java similarity index 62% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerEvent.java rename to java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerEvent.java index 70633b3..94e0eb6 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerEvent.java +++ b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events; import io.eventuate.Event; @@ -7,6 +7,6 @@ /** * Created by Main on 11.02.2016. */ -@EventEntity(entity = "net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.Customer") +@EventEntity(entity = "net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.Customer") public abstract class CustomerEvent implements Event { } \ No newline at end of file diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerToAccountDeleted.java b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerToAccountDeleted.java similarity index 81% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerToAccountDeleted.java rename to java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerToAccountDeleted.java index 06876b8..c7f0d2b 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/customers/CustomerToAccountDeleted.java +++ b/java-spring/customers-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/domain/events/CustomerToAccountDeleted.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events; public class CustomerToAccountDeleted extends CustomerEvent { diff --git a/java-spring/customers-service-api-web/build.gradle b/java-spring/customers-service-api-web/build.gradle new file mode 100644 index 0000000..7e5f160 --- /dev/null +++ b/java-spring/customers-service-api-web/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") +} diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/AddToAccountResponse.java b/java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/AddToAccountResponse.java similarity index 80% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/AddToAccountResponse.java rename to java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/AddToAccountResponse.java index d1012ba..a38f749 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/AddToAccountResponse.java +++ b/java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/AddToAccountResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi; public class AddToAccountResponse { diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/CustomerResponse.java b/java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/CustomerResponse.java similarity index 83% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/CustomerResponse.java rename to java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/CustomerResponse.java index 09a54e7..b842802 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/customers/CustomerResponse.java +++ b/java-spring/customers-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/webapi/CustomerResponse.java @@ -1,5 +1,6 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.customers; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi; +import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; diff --git a/java-spring/customers-service/Dockerfile b/java-spring/customers-service/Dockerfile index 0adc92d..2bdbd4f 100644 --- a/java-spring/customers-service/Dockerfile +++ b/java-spring/customers-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar customers-service.jar -EXPOSE 8080 -COPY build/libs/customers-service.jar . +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/customers-service.jar service.jar \ No newline at end of file diff --git a/java-spring/customers-service/build.gradle b/java-spring/customers-service/build.gradle index 047df3c..2e57e21 100644 --- a/java-spring/customers-service/build.gradle +++ b/java-spring/customers-service/build.gradle @@ -1,19 +1,23 @@ apply plugin: VerifyMongoDBConfigurationPlugin -apply plugin: VerifyEventStoreEnvironmentPlugin - -apply plugin: 'spring-boot' -apply plugin: EventuateDependencyPlugin +apply plugin: 'org.springframework.boot' dependencies { - compile project(":common") - compile project(":common-backend") compile project(":common-swagger") - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" + compile project(":customers-service-api-messaging") + compile project(":customers-service-api-web") + + compile project(":accounts-service-api-web") + + compile "io.eventuate.local.java:eventuate-local-java-spring-jdbc:$eventuateLocalVersion" + + compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" + testCompile project(":common-auth") testCompile project(":testutil") testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" + testCompile "io.eventuate.local.java:eventuate-client-java-spring-jdbc:$eventuateLocalVersion" } \ No newline at end of file diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerBackendConfiguration.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomerConfiguration.java similarity index 70% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerBackendConfiguration.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomerConfiguration.java index 77fd7f0..f21ce45 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerBackendConfiguration.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomerConfiguration.java @@ -1,16 +1,18 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice; import io.eventuate.AggregateRepository; import io.eventuate.EventuateAggregateStore; import io.eventuate.javaclient.spring.EnableEventHandlers; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.service.CustomerService; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.Customer; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.CustomerCommand; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @EnableEventHandlers -@ComponentScan -public class CustomerBackendConfiguration { +public class CustomerConfiguration { @Bean public CustomerService customerService(AggregateRepository customerRepository) { diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersServiceMain.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersServiceMain.java index 64815e7..ed4c165 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersServiceMain.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersServiceMain.java @@ -1,20 +1,17 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersservice; -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import io.eventuate.local.java.spring.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web.CustomersWebConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; -import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({CustomersWebConfiguration.class, EventuateDriverConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({CustomerConfiguration.class, CustomersWebConfiguration.class, EventuateDriverConfiguration.class}) @EnableAutoConfiguration +@ComponentScan public class CustomersServiceMain { public static void main(String[] args) { diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/AddToAccountCommand.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/AddToAccountCommand.java similarity index 95% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/AddToAccountCommand.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/AddToAccountCommand.java index b685ffc..019f5b4 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/AddToAccountCommand.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/AddToAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CreateCustomerCommand.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CreateCustomerCommand.java similarity index 95% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CreateCustomerCommand.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CreateCustomerCommand.java index a34c7c1..c776d9a 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CreateCustomerCommand.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CreateCustomerCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/Customer.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/Customer.java similarity index 76% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/Customer.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/Customer.java index d97d104..3c26f02 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/Customer.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/Customer.java @@ -1,12 +1,12 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain; import io.eventuate.Event; import io.eventuate.EventUtil; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerAddedToAccount; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerCreatedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerToAccountDeleted; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerAddedToAccount; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerCreatedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerToAccountDeleted; import java.util.List; diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerCommand.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CustomerCommand.java similarity index 57% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerCommand.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CustomerCommand.java index da3c411..2e08e32 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerCommand.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/CustomerCommand.java @@ -1,6 +1,6 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain; import io.eventuate.Command; -interface CustomerCommand extends Command { +public interface CustomerCommand extends Command { } diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/DeleteToAccountCommand.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/DeleteToAccountCommand.java similarity index 95% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/DeleteToAccountCommand.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/DeleteToAccountCommand.java index bb1aaa4..e58c8d6 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/DeleteToAccountCommand.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/domain/DeleteToAccountCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain; public class DeleteToAccountCommand implements CustomerCommand { diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerService.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerService.java similarity index 70% rename from java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerService.java rename to java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerService.java index 71619ba..57dec63 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerService.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerService.java @@ -1,10 +1,15 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.service; import io.eventuate.AggregateRepository; import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.AddToAccountCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.CreateCustomerCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.Customer; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.CustomerCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.DeleteToAccountCommand; import java.util.concurrent.CompletableFuture; diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomerController.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomerController.java index fa6f570..4f6ee63 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomerController.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomerController.java @@ -1,11 +1,11 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.DeleteAccountResponse; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.AddToAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.DeleteAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi.AddToAccountResponse; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi.CustomerResponse; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.CustomerService; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; diff --git a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomersWebConfiguration.java b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomersWebConfiguration.java index 1567586..6f6ad61 100644 --- a/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomersWebConfiguration.java +++ b/java-spring/customers-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/web/CustomersWebConfiguration.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend.CustomerBackendConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -11,7 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration -@Import({CustomerBackendConfiguration.class}) +@Import(CommonSwaggerConfiguration.class) @ComponentScan public class CustomersWebConfiguration extends WebMvcConfigurerAdapter { diff --git a/java-spring/customers-service/src/main/resources/application.properties b/java-spring/customers-service/src/main/resources/application.properties new file mode 100644 index 0000000..7c2c49c --- /dev/null +++ b/java-spring/customers-service/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/eventuate +spring.datasource.username=mysqluser +spring.datasource.password=mysqlpw +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 diff --git a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceIntegrationTest.java b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceIntegrationTest.java index bd88150..d76d22e 100644 --- a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceIntegrationTest.java +++ b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceIntegrationTest.java @@ -1,27 +1,23 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersservice; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi.CustomerResponse; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.client.RestTemplate; import static net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils.generateCustomerInfo; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = CustomersCommandSideServiceTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = CustomersCommandSideServiceTestConfiguration.class) public class CustomersCommandSideServiceIntegrationTest { - @Value("${local.server.port}") + @LocalServerPort private int port; private String baseUrl(String path) { diff --git a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceTestConfiguration.java b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceTestConfiguration.java index baf0dd9..dc16846 100644 --- a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceTestConfiguration.java +++ b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/CustomersCommandSideServiceTestConfiguration.java @@ -1,10 +1,11 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersservice; import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfigurationAdapter; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web.CustomersWebConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -16,18 +17,13 @@ import java.util.List; @Configuration -@Import({CustomersWebConfiguration.class, +@Import({CustomerConfiguration.class, + CustomersWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class, - AuthConfiguration.class}) + AuthConfigurationAdapter.class}) @EnableAutoConfiguration public class CustomersCommandSideServiceTestConfiguration { - @Bean - public HttpMessageConverters customConverters() { - HttpMessageConverter additional = new MappingJackson2HttpMessageConverter(); - return new HttpMessageConverters(additional); - } - @Bean public RestTemplate restTemplate(HttpMessageConverters converters) { RestTemplate restTemplate = new RestTemplate(); diff --git a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerEventTest.java b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerEventTest.java similarity index 73% rename from java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerEventTest.java rename to java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerEventTest.java index 731eea6..d373b1e 100644 --- a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerEventTest.java +++ b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerEventTest.java @@ -1,6 +1,7 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.service; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.Customer; import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractEntityEventTest; public class CustomerEventTest extends AbstractEntityEventTest { diff --git a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerTest.java b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerTest.java similarity index 72% rename from java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerTest.java rename to java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerTest.java index 7d2a23f..764948e 100644 --- a/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/backend/CustomerTest.java +++ b/java-spring/customers-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersservice/service/CustomerTest.java @@ -1,8 +1,10 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersservice.service; import io.eventuate.Event; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerCreatedEvent; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerCreatedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.CreateCustomerCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.domain.Customer; import org.junit.Assert; import org.junit.Test; diff --git a/java-spring/customers-query-side-common/build.gradle b/java-spring/customers-view-service-api-common/build.gradle similarity index 76% rename from java-spring/customers-query-side-common/build.gradle rename to java-spring/customers-view-service-api-common/build.gradle index fea6765..f4737fc 100644 --- a/java-spring/customers-query-side-common/build.gradle +++ b/java-spring/customers-view-service-api-common/build.gradle @@ -5,6 +5,4 @@ dependencies { compile "commons-lang:commons-lang:2.6" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" - - testCompile group: 'junit', name: 'junit', version: '4.11' } diff --git a/java-spring/customers-query-side-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/common/QuerySideCustomer.java b/java-spring/customers-view-service-api-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/commonapi/CustomerView.java similarity index 85% rename from java-spring/customers-query-side-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/common/QuerySideCustomer.java rename to java-spring/customers-view-service-api-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/commonapi/CustomerView.java index 234a463..9b7b68f 100644 --- a/java-spring/customers-query-side-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/web/customers/queryside/common/QuerySideCustomer.java +++ b/java-spring/customers-view-service-api-common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/commonapi/CustomerView.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common; +package net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Address; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Name; @@ -12,7 +12,7 @@ * Created by Main on 05.02.2016. */ @Document -public class QuerySideCustomer { +public class CustomerView { private String id; private Name name; @@ -24,10 +24,10 @@ public class QuerySideCustomer { private Address address; private Map toAccounts; - public QuerySideCustomer() { + public CustomerView() { } - public QuerySideCustomer(String id, Name name, String email, String password, String ssn, String phoneNumber, Address address, Map toAccounts) { + public CustomerView(String id, Name name, String email, String password, String ssn, String phoneNumber, Address address, Map toAccounts) { this.id = id; this.name = name; this.email = email; diff --git a/java-spring/customers-view-service-api-web/build.gradle b/java-spring/customers-view-service-api-web/build.gradle new file mode 100644 index 0000000..a669db8 --- /dev/null +++ b/java-spring/customers-view-service-api-web/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") + + compile project(":customers-view-service-api-common") +} diff --git a/java-spring/customers-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/webapi/CustomersQueryResponse.java b/java-spring/customers-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/webapi/CustomersQueryResponse.java new file mode 100644 index 0000000..cbaf66d --- /dev/null +++ b/java-spring/customers-view-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customers/view/webapi/CustomersQueryResponse.java @@ -0,0 +1,28 @@ +package net.chrisrichardson.eventstore.javaexamples.banking.customers.view.webapi; + +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; + +import java.util.List; + +/** + * Created by Main on 05.02.2016. + */ +public class CustomersQueryResponse { + + private List customers; + + public CustomersQueryResponse() { + } + + public CustomersQueryResponse(List customers) { + this.customers = customers; + } + + public List getCustomers() { + return customers; + } + + public void setCustomers(List customers) { + this.customers = customers; + } +} diff --git a/java-spring/customers-view-service/Dockerfile b/java-spring/customers-view-service/Dockerfile index 9c7ea55..ba1babe 100644 --- a/java-spring/customers-view-service/Dockerfile +++ b/java-spring/customers-view-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar customers-view-service.jar -EXPOSE 8080 -COPY build/libs/customers-view-service.jar . \ No newline at end of file +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/customers-view-service.jar service.jar diff --git a/java-spring/customers-view-service/build.gradle b/java-spring/customers-view-service/build.gradle index bd2b72e..1cc42f6 100644 --- a/java-spring/customers-view-service/build.gradle +++ b/java-spring/customers-view-service/build.gradle @@ -1,14 +1,15 @@ apply plugin: VerifyMongoDBConfigurationPlugin -apply plugin: VerifyEventStoreEnvironmentPlugin -apply plugin: EventuateDependencyPlugin -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' dependencies { - compile project(":common-backend") - compile project(":customers-query-side-common") + compile project(":accounts-service-api-messaging") + compile project(":customers-service-api-messaging") + compile project(":customers-view-service-api-web") compile project(":common-swagger") + compile "io.eventuate.local.java:eventuate-local-java-spring-jdbc:$eventuateLocalVersion" + compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" @@ -18,13 +19,7 @@ dependencies { compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3' testCompile project(":testutil") - testCompile project(":customers-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 -} - + testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" + testCompile "io.eventuate.local.java:eventuate-client-java-spring-jdbc:$eventuateLocalVersion" +} \ No newline at end of file diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewBackendConfiguration.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomerViewConfiguration.java similarity index 66% rename from java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewBackendConfiguration.java rename to java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomerViewConfiguration.java index ce5da81..e7d545c 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewBackendConfiguration.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomerViewConfiguration.java @@ -1,8 +1,12 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice; import io.eventuate.javaclient.spring.EnableEventHandlers; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service.CustomerInfoUpdateService; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service.CustomerQueryService; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service.CustomerQueryWorkflow; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain.CustomerViewRepository; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain.ViewDependencyChecker; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; @@ -13,8 +17,7 @@ @Configuration @EnableMongoRepositories @EnableEventHandlers -@ComponentScan -public class CustomerViewBackendConfiguration { +public class CustomerViewConfiguration { @Bean public CustomerQueryWorkflow customerQueryWorkflow(CustomerInfoUpdateService accountInfoUpdateService) { return new CustomerQueryWorkflow(accountInfoUpdateService); diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersViewServiceMain.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersViewServiceMain.java index f18eebe..676776c 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersViewServiceMain.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersViewServiceMain.java @@ -1,22 +1,19 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice; -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import io.eventuate.local.java.spring.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web.CustomersViewWebConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; -import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({CustomersViewWebConfiguration.class, - EventuateDriverConfiguration.class, - CommonSwaggerConfiguration.class}) +@Import({CustomerViewConfiguration.class, + CustomersViewWebConfiguration.class, + EventuateDriverConfiguration.class}) @EnableAutoConfiguration +@ComponentScan public class CustomersViewServiceMain { public static void main(String[] args) { diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewRepository.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewRepository.java deleted file mode 100644 index 6d6f8cb..0000000 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerViewRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; - -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; -import org.springframework.data.mongodb.repository.MongoRepository; - -import java.util.List; - -interface CustomerViewRepository extends MongoRepository { - - List findByEmailLike(String email); -} diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/CustomerViewRepository.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/CustomerViewRepository.java new file mode 100644 index 0000000..0b589c8 --- /dev/null +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/CustomerViewRepository.java @@ -0,0 +1,11 @@ +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain; + +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.List; + +public interface CustomerViewRepository extends MongoRepository { + + List findByEmailLike(String email); +} diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/ViewDependencyChecker.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/ViewDependencyChecker.java similarity index 91% rename from java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/ViewDependencyChecker.java rename to java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/ViewDependencyChecker.java index 2a0d095..13885d0 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/ViewDependencyChecker.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/domain/ViewDependencyChecker.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,7 +19,7 @@ public void checkDependencies() { try { logger.info("Checking mongodb connectivity {}", System.getenv("SPRING_DATA_MONGODB_URI")); - mongoTemplate.getDb().getCollectionNames(); + mongoTemplate.getCollectionNames(); } catch (Throwable e) { throw new RuntimeException("Error connecting to Mongo - have you set SPRING_DATA_MONGODB_URI or --spring.data.mongodb_uri?", e); diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateService.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateService.java similarity index 86% rename from java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateService.java rename to java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateService.java index 7a2a324..77ed478 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateService.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateService.java @@ -1,8 +1,9 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain.CustomerViewRepository; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DuplicateKeyException; @@ -31,7 +32,7 @@ public CustomerInfoUpdateService(CustomerViewRepository querySideCustomerReposit public void create(String id, CustomerInfo customerInfo) { try { - querySideCustomerRepository.save(new QuerySideCustomer(id, + querySideCustomerRepository.save(new CustomerView(id, customerInfo.getName(), customerInfo.getUserCredentials().getEmail(), customerInfo.getUserCredentials().getPassword(), @@ -51,20 +52,20 @@ public void addToAccount(String id, ToAccountInfo accountInfo) { mongoTemplate.upsert(new Query(where("id").is(id)), new Update(). set("toAccounts." + accountInfo.getId(), accountInfo), - QuerySideCustomer.class); + CustomerView.class); } public void deleteToAccountFromAllCustomers(String accountId) { mongoTemplate.updateMulti(new Query(where("toAccounts." + accountId).exists(true)), new Update(). unset("toAccounts." + accountId), - QuerySideCustomer.class); + CustomerView.class); } public void deleteToAccount(String customerId, String accountId) { mongoTemplate.upsert(new Query(where("id").is(customerId)), new Update(). unset("toAccounts." + accountId), - QuerySideCustomer.class); + CustomerView.class); } } diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryService.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryService.java similarity index 51% rename from java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryService.java rename to java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryService.java index 1296783..4aae6d9 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryService.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryService.java @@ -1,7 +1,8 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service; import io.eventuate.CompletableFutureUtil; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.domain.CustomerViewRepository; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.springframework.dao.EmptyResultDataAccessException; import java.util.List; @@ -15,16 +16,12 @@ public CustomerQueryService(CustomerViewRepository querySideCustomerRepository) this.querySideCustomerRepository = querySideCustomerRepository; } - public CompletableFuture findByCustomerId(String customerId) { - QuerySideCustomer customer = querySideCustomerRepository.findOne(customerId); - if (customer == null) - return CompletableFutureUtil.failedFuture(new EmptyResultDataAccessException(1)); - else - return CompletableFuture.completedFuture(customer); + public CompletableFuture findByCustomerId(String customerId) { + return querySideCustomerRepository.findById(customerId).map(c -> CompletableFuture.completedFuture(c)).orElse(CompletableFutureUtil.failedFuture(new EmptyResultDataAccessException(1))); } - public CompletableFuture> findByEmail(String email) { - List customers = querySideCustomerRepository.findByEmailLike(email); + public CompletableFuture> findByEmail(String email) { + List customers = querySideCustomerRepository.findByEmailLike(email); if (customers.isEmpty()) return CompletableFutureUtil.failedFuture(new EmptyResultDataAccessException(1)); else diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryWorkflow.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryWorkflow.java similarity index 80% rename from java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryWorkflow.java rename to java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryWorkflow.java index 1c4e2c5..1bd026b 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerQueryWorkflow.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerQueryWorkflow.java @@ -1,13 +1,13 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service; import io.eventuate.DispatchedEvent; import io.eventuate.EventHandlerMethod; import io.eventuate.EventSubscriber; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountDeletedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerAddedToAccount; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerCreatedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.customers.CustomerToAccountDeleted; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDeletedEvent; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerAddedToAccount; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerCreatedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.domain.events.CustomerToAccountDeleted; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomerQueryController.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomerQueryController.java index c00a24d..f5b3b0e 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomerQueryController.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomerQueryController.java @@ -1,7 +1,8 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend.CustomerQueryService; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.webapi.CustomersQueryResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service.CustomerQueryService; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.http.HttpStatus; @@ -25,7 +26,7 @@ public CustomerQueryController(CustomerQueryService customerQueryService) { } @RequestMapping(value = "/customers/{customerId}", method = RequestMethod.GET) - public CompletableFuture getCustomer(@PathVariable String customerId) { + public CompletableFuture getCustomer(@PathVariable String customerId) { return customerQueryService.findByCustomerId(customerId); } @@ -42,7 +43,7 @@ public void customersNotFound() { } - private CustomersQueryResponse getCustomersQueryResponse(List customersList) { + private CustomersQueryResponse getCustomersQueryResponse(List customersList) { return new CustomersQueryResponse(customersList); } } diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersQueryResponse.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersQueryResponse.java deleted file mode 100644 index 235cbe0..0000000 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersQueryResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web; - -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; - -import java.util.List; - -/** - * Created by Main on 05.02.2016. - */ -public class CustomersQueryResponse { - - private List customers; - - public CustomersQueryResponse() { - } - - public CustomersQueryResponse(List customers) { - this.customers = customers; - } - - public List getCustomers() { - return customers; - } - - public void setCustomers(List customers) { - this.customers = customers; - } -} diff --git a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersViewWebConfiguration.java b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersViewWebConfiguration.java index 0ea92c8..04d154c 100644 --- a/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersViewWebConfiguration.java +++ b/java-spring/customers-view-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/web/CustomersViewWebConfiguration.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend.CustomerViewBackendConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -11,7 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration -@Import({CustomerViewBackendConfiguration.class}) +@Import({CommonSwaggerConfiguration.class}) @ComponentScan public class CustomersViewWebConfiguration extends WebMvcConfigurerAdapter { diff --git a/java-spring/customers-view-service/src/main/resources/application.properties b/java-spring/customers-view-service/src/main/resources/application.properties new file mode 100644 index 0000000..7c2c49c --- /dev/null +++ b/java-spring/customers-view-service/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/eventuate +spring.datasource.username=mysqluser +spring.datasource.password=mysqlpw +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 diff --git a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceIntegrationTest.java b/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceIntegrationTest.java deleted file mode 100644 index 2f68662..0000000 --- a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceIntegrationTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice; - -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse; -import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.client.RestTemplate; - -import javax.annotation.PostConstruct; - -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils.generateCustomerInfo; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = CustomersQuerySideServiceTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) -public class CustomersQuerySideServiceIntegrationTest { - - @Value("${local.server.port}") - private int port; - - private String baseUrl(String path) { - return "http://localhost:" + port + "/api" + path; - } - - @Autowired - RestTemplate restTemplate; - - CustomersTestUtils customersTestUtils; - - @PostConstruct - private void init() { - customersTestUtils = new CustomersTestUtils(restTemplate, baseUrl("/customers/")); - } - - - @Test - public void shouldGetCustomerById() { - - CustomerInfo customerInfo = generateCustomerInfo(); - - final CustomerResponse customerResponse = restTemplate.postForEntity(baseUrl("/customers"), customerInfo, CustomerResponse.class).getBody(); - final String customerId = customerResponse.getId(); - - customersTestUtils.assertCustomerResponse(customerId, customerInfo); - } - -} diff --git a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceTestConfiguration.java b/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceTestConfiguration.java deleted file mode 100644 index bd462e6..0000000 --- a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/CustomersQuerySideServiceTestConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice; - -import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web.CustomersWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web.CustomersViewWebConfiguration; -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; -import org.springframework.context.annotation.Import; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.client.RestTemplate; - -import java.util.Arrays; -import java.util.List; - -@Configuration -@Import({CustomersWebConfiguration.class, CustomersViewWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class, AuthConfiguration.class}) -@EnableAutoConfiguration -public class CustomersQuerySideServiceTestConfiguration { - - @Bean - public RestTemplate restTemplate(HttpMessageConverters converters) { - RestTemplate restTemplate = new RestTemplate(); - HttpMessageConverter httpMessageConverter = converters.getConverters().get(0); - List> httpMessageConverters = Arrays.asList(new MappingJackson2HttpMessageConverter()); - restTemplate.setMessageConverters((List>) httpMessageConverters); - return restTemplate; - } -} diff --git a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateServiceTest.java b/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateServiceTest.java similarity index 57% rename from java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateServiceTest.java rename to java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateServiceTest.java index 7c37109..576eb32 100644 --- a/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/backend/CustomerInfoUpdateServiceTest.java +++ b/java-spring/customers-view-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/customersviewservice/service/CustomerInfoUpdateServiceTest.java @@ -1,17 +1,18 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.service; +import io.eventuate.common.id.IdGenerator; +import io.eventuate.common.id.IdGeneratorImpl; import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import io.eventuate.javaclient.spring.jdbc.IdGenerator; -import io.eventuate.javaclient.spring.jdbc.IdGeneratorImpl; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.ToAccountInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.CustomerViewConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web.CustomersViewWebConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -22,13 +23,14 @@ import static org.junit.Assert.*; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = CustomerInfoUpdateServiceTest.CustomerInfoUpdateServiceTestConfiguration.class) -@IntegrationTest +@SpringBootTest(classes = CustomerInfoUpdateServiceTest.CustomerInfoUpdateServiceTestConfiguration.class) public class CustomerInfoUpdateServiceTest { @Configuration @EnableAutoConfiguration - @Import({CustomerViewBackendConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) + @Import({CustomerViewConfiguration.class, + CustomersViewWebConfiguration.class, + EmbeddedTestAggregateStoreConfiguration.class}) public static class CustomerInfoUpdateServiceTestConfiguration { } @@ -47,13 +49,13 @@ public void shouldSaveQuerysideCustomer() throws ExecutionException, Interrupted CustomerInfo customerInfo = generateCustomerInfo(); customerInfoUpdateService.create(customerId, customerInfo); - QuerySideCustomer querySideCustomer = customerQueryService.findByCustomerId(customerId).get(); + CustomerView customerView = customerQueryService.findByCustomerId(customerId).get(); - assertEquals(customerInfo.getName(), querySideCustomer.getName()); - assertEquals(customerInfo.getAddress(), querySideCustomer.getAddress()); - assertEquals(customerInfo.getUserCredentials().getEmail(), querySideCustomer.getEmail()); - assertEquals(customerInfo.getPhoneNumber(), querySideCustomer.getPhoneNumber()); - assertEquals(customerInfo.getSsn(), querySideCustomer.getSsn()); + assertEquals(customerInfo.getName(), customerView.getName()); + assertEquals(customerInfo.getAddress(), customerView.getAddress()); + assertEquals(customerInfo.getUserCredentials().getEmail(), customerView.getEmail()); + assertEquals(customerInfo.getPhoneNumber(), customerView.getPhoneNumber()); + assertEquals(customerInfo.getSsn(), customerView.getSsn()); } @Test @@ -69,14 +71,14 @@ public void shouldAddAndDeleteToAccount() throws ExecutionException, Interrupted customerInfoUpdateService.addToAccount(customerId, toAccountInfo); - QuerySideCustomer querySideCustomer = customerQueryService.findByCustomerId(customerId).get(); + CustomerView customerView = customerQueryService.findByCustomerId(customerId).get(); - assertTrue(querySideCustomer.getToAccounts().containsKey(accountId)); - assertEquals(toAccountInfo, querySideCustomer.getToAccounts().get(accountId)); + assertTrue(customerView.getToAccounts().containsKey(accountId)); + assertEquals(toAccountInfo, customerView.getToAccounts().get(accountId)); customerInfoUpdateService.deleteToAccountFromAllCustomers(accountId); - querySideCustomer = customerQueryService.findByCustomerId(customerId).get(); + customerView = customerQueryService.findByCustomerId(customerId).get(); - assertFalse(querySideCustomer.getToAccounts().containsKey(accountId)); + assertFalse(customerView.getToAccounts().containsKey(accountId)); } } \ No newline at end of file diff --git a/java-spring/docker-compose-common.yml b/java-spring/docker-compose-common.yml deleted file mode 100644 index 7cd0387..0000000 --- a/java-spring/docker-compose-common.yml +++ /dev/null @@ -1,54 +0,0 @@ -apigateway: - build: ./api-gateway-service/ - restart: unless-stopped - ports: - - "8080:8080" - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - ACCOUNTS_COMMANDSIDE_SERVICE_HOST: accountsservice - TRANSFERS_COMMANDSIDE_SERVICE_HOST: transactionsservice - ACCOUNTS_QUERYSIDE_SERVICE_HOST: accountsviewservice - CUSTOMERS_COMMANDSIDE_SERVICE_HOST: customersservice - CUSTOMERS_QUERYSIDE_SERVICE_HOST: customersviewservice - - -accountsservice: - build: ./accounts-service/ - restart: unless-stopped - ports: - - "8085:8080" - -transactionsservice: - build: ./transactions-service/ - restart: unless-stopped - ports: - - "8082:8080" - -accountsviewservice: - build: ./accounts-view-service/ - restart: unless-stopped - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - ports: - - "8081:8080" - -customersservice: - build: ./customers-service/ - restart: unless-stopped - ports: - - "8083:8080" - -customersviewservice: - build: ./customers-view-service/ - restart: unless-stopped - ports: - - "8084:8080" - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - -mongodb: - image: mongo:3.0.4 - hostname: mongodb - command: mongod --smallfiles - ports: - - "27017:27017" diff --git a/java-spring/docker-compose-eventuate-local.yml b/java-spring/docker-compose-eventuate-local.yml deleted file mode 100644 index cf549f6..0000000 --- a/java-spring/docker-compose-eventuate-local.yml +++ /dev/null @@ -1,161 +0,0 @@ -zookeeper: - image: eventuateio/eventuateio-local-zookeeper:0.9.0 - ports: - - 2181:2181 - - 2888:2888 - - 3888:3888 - - -kafka: - image: eventuateio/eventuateio-local-kafka:0.9.0 - ports: - - 9092:9092 - links: - - zookeeper - environment: - - ADVERTISED_HOST_NAME=${DOCKER_HOST_IP} - - KAFKA_HEAP_OPTS=-Xmx320m -Xms320m - - ZOOKEEPER_SERVERS=zookeeper:2181 - -mysql: - image: eventuateio/eventuateio-local-mysql:0.9.0 - ports: - - 3306:3306 - environment: - - MYSQL_ROOT_PASSWORD=rootpassword - - MYSQL_USER=mysqluser - - MYSQL_PASSWORD=mysqlpw - - -cdcservice: - image: eventuateio/eventuateio-local-cdc-service:0.9.0 - ports: - - "8099:8080" - links: - - mysql - - kafka - - zookeeper - environment: - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword - -mongodb: - extends: - file: docker-compose-common.yml - service: mongodb - -apigateway: - extends: - file: docker-compose-common.yml - service: apigateway - links: - - accountsservice - - transactionsservice - - accountsviewservice - - customersservice - - customersviewservice - - mongodb - -accountsservice: - extends: - file: docker-compose-common.yml - service: accountsservice - links: - - mysql - - kafka - - zookeeper - environment: - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword - - -transactionsservice: - extends: - file: docker-compose-common.yml - service: transactionsservice - links: - - mysql - - kafka - - zookeeper - environment: - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword - -accountsviewservice: - extends: - file: docker-compose-common.yml - service: accountsviewservice - links: - - mongodb - - mysql - - kafka - - zookeeper - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword - - -customersservice: - extends: - file: docker-compose-common.yml - service: customersservice - links: - - mysql - - kafka - - zookeeper - environment: - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword - -customersviewservice: - extends: - file: docker-compose-common.yml - service: customersviewservice - links: - - mongodb - - mysql - - kafka - - zookeeper - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - environment: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate - SPRING_DATASOURCE_USERNAME: mysqluser - SPRING_DATASOURCE_PASSWORD: mysqlpw - SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver - EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 - EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 - EVENTUATELOCAL_CDC_DB_USER_NAME: root - EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword diff --git a/java-spring/docker-compose.yml b/java-spring/docker-compose.yml index 51deb2a..4c05c56 100644 --- a/java-spring/docker-compose.yml +++ b/java-spring/docker-compose.yml @@ -1,61 +1,188 @@ -apigateway: - extends: - file: docker-compose-common.yml - service: apigateway - links: - - accountsservice - - transactionsservice - - accountsviewservice - - customersservice - - customersviewservice - - mongodb +version: '3' +services: + zookeeper: + image: confluentinc/cp-zookeeper:5.2.4 + ports: + - 2181:2181 + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + KAFKA_HEAP_OPTS: -Xmx64m + + kafka: + image: "confluentinc/cp-kafka:5.2.4" + ports: + - 9092:9092 + - 29092:29092 + depends_on: + - zookeeper + environment: + KAFKA_LISTENERS: LC://kafka:29092,LX://kafka:9092 + KAFKA_ADVERTISED_LISTENERS: LC://kafka:29092,LX://${DOCKER_HOST_IP:-localhost}:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LC:PLAINTEXT,LX:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: LC + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_HEAP_OPTS: -Xmx192m + + mysql: + image: eventuateio/eventuate-mysql:$EVENTUATE_COMMON_VERSION + ports: + - 3306:3306 + environment: + - MYSQL_ROOT_PASSWORD=rootpassword + - MYSQL_USER=mysqluser + - MYSQL_PASSWORD=mysqlpw + + + cdc-service: + image: eventuateio/eventuate-cdc-service:$EVENTUATE_CDC_VERSION + ports: + - "8099:8080" + depends_on: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword + EVENTUATELOCAL_CDC_READER_NAME: MySqlReader + EVENTUATELOCAL_CDC_OFFSET_STORE_KEY: MySqlBinlog + EVENTUATELOCAL_CDC_MYSQL_BINLOG_CLIENT_UNIQUE_ID: 1234567890 + EVENTUATELOCAL_CDC_READ_OLD_DEBEZIUM_DB_OFFSET_STORAGE_TOPIC: "false" + EVENTUATE_CDC_TYPE: "EventuateLocal" + + mongodb: + image: mongo:3.0.4 + hostname: mongodb + command: mongod --smallfiles + ports: + - "27017:27017" -accountsservice: - extends: - file: docker-compose-common.yml - service: accountsservice - environment: - EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} - EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} + api-gateway-service: + build: + context: ./api-gateway-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8080:8080" + environment: + SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb + ACCOUNTS_COMMANDSIDE_SERVICE_HOST: accounts-service + TRANSFERS_COMMANDSIDE_SERVICE_HOST: transactions-service + ACCOUNTS_QUERYSIDE_SERVICE_HOST: accounts-view-service + CUSTOMERS_COMMANDSIDE_SERVICE_HOST: customers-service + CUSTOMERS_QUERYSIDE_SERVICE_HOST: customers-view-service + depends_on: + - accounts-service + - transactions-service + - accounts-view-service + - customers-service + - customers-view-service + - mongodb -transactionsservice: - extends: - file: docker-compose-common.yml - service: transactionsservice - environment: - EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} - EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} + accounts-service: + build: + context: ./accounts-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8085:8080" + depends_on: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 + transactions-service: + build: + context: ./transactions-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8082:8080" + depends_on: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 -accountsviewservice: - extends: - file: docker-compose-common.yml - service: accountsviewservice - links: - - mongodb - environment: - EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} - EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} + accounts-view-service: + build: + context: ./accounts-view-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8081:8080" + depends_on: + - mongodb + - mysql + - kafka + - zookeeper + environment: + SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 -customersservice: - extends: - file: docker-compose-common.yml - service: customersservice - environment: - EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} - EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} -customersviewservice: - extends: - file: docker-compose-common.yml - service: customersviewservice - links: - - mongodb - environment: - EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} - EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} + customers-service: + build: + context: ./customers-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8083:8080" + depends_on: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 -mongodb: - extends: - file: docker-compose-common.yml - service: mongodb + customers-view-service: + build: + context: ./customers-view-service/ + args: + baseImageVersion: ${EVENTUATE_JAVA_BASE_IMAGE_VERSION?} + restart: unless-stopped + ports: + - "8084:8080" + depends_on: + - mongodb + - mysql + - kafka + - zookeeper + environment: + SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 \ No newline at end of file diff --git a/java-spring/gradle.properties b/java-spring/gradle.properties index 1135d71..f0af53d 100644 --- a/java-spring/gradle.properties +++ b/java-spring/gradle.properties @@ -1,9 +1,17 @@ org.gradle.jvmargs=-XX:MaxPermSize=512m -eventuateMavenRepoUrl= +eventuateMavenRepoUrl=https://dl.bintray.com/eventuateio-oss/eventuate-maven-release,https://dl.bintray.com/eventuateio-oss/eventuate-maven-milestone,https://dl.bintray.com/eventuateio-oss/eventuate-maven-rc,file:///Users/cer/.m2/testdeploy,https://snapshots.repositories.eventuate.io/repository -springBootVersion=1.3.5.RELEASE +springBootVersion=2.3.4.RELEASE +dockerComposePluginVersion=0.13.4 -eventuateClientVersion=0.14.0.RELEASE -eventuateLocalVersion=0.11.0.RELEASE +eventuateLocalVersion=0.35.0.BUILD-SNAPSHOT +eventuateUtilVersion=0.8.0.BUILD-SNAPSHOT + +eventuateCommonImageVersion=0.12.0.RELEASE +eventuateCdcImageVersion=0.9.0.RELEASE + +eventuateExamplesBaseImageVersion=BUILD-6 + +removeContainers=false \ No newline at end of file diff --git a/java-spring/gradle/wrapper/gradle-wrapper.properties b/java-spring/gradle/wrapper/gradle-wrapper.properties index c8b3142..2f6ef87 100644 --- a/java-spring/gradle/wrapper/gradle-wrapper.properties +++ b/java-spring/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-2.11-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip \ No newline at end of file diff --git a/java-spring/rest-api-integration-tests/build.gradle b/java-spring/rest-api-integration-tests/build.gradle deleted file mode 100644 index 8ed53ba..0000000 --- a/java-spring/rest-api-integration-tests/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -apply plugin: VerifyMongoDBConfigurationPlugin - -dependencies { - testCompile project(":common-auth-web") - testCompile project(":transactions-service") - testCompile project(":accounts-service") - testCompile project(":accounts-view-service") - testCompile project(":customers-service") - testCompile project(":customers-view-service") - testCompile project(":testutil") - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" -} \ No newline at end of file diff --git a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java b/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java deleted file mode 100644 index 43193d7..0000000 --- a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingAuthTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.web; - -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo; -import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; -import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.client.RestTemplate; - -import javax.annotation.PostConstruct; - -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils.generateCustomerInfo; - -/** - * Created by Main on 15.02.2016. - */ -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = BankingWebTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) -public class BankingAuthTest { - - @Value("${local.server.port}") - private int port; - - @Autowired - RestTemplate restTemplate; - - CustomersTestUtils customersTestUtils; - - @PostConstruct - private void init() { - customersTestUtils = new CustomersTestUtils(restTemplate, baseUrl("/customers/")); - } - - private String baseUrl(String path) { - return "http://localhost:" + port + "/api" + path; - } - - @Test - public void shouldCreateCustomerAndLogin() { - CustomerInfo customerInfo = generateCustomerInfo(); - - final CustomerResponse customerResponse = restTemplate.postForEntity(baseUrl("/customers"), customerInfo, CustomerResponse.class).getBody(); - final String customerId = customerResponse.getId(); - - Assert.assertNotNull(customerId); - Assert.assertEquals(customerInfo, customerResponse.getCustomerInfo()); - - customersTestUtils.assertCustomerResponse(customerId, customerInfo); - - final QuerySideCustomer loginQuerySideCustomer = restTemplate.postForEntity(baseUrl("/login"), customerInfo.getUserCredentials(), QuerySideCustomer.class).getBody(); - - customersTestUtils.assertQuerySideCustomerEqualscCustomerInfo(loginQuerySideCustomer, customerResponse.getCustomerInfo()); - } -} diff --git a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java b/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java deleted file mode 100644 index b0fc3ff..0000000 --- a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebIntegrationTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.web; - -import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractRestAPITest; - -import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.client.RestTemplate; -import javax.annotation.PostConstruct; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = BankingWebTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) -public class BankingWebIntegrationTest extends AbstractRestAPITest { - - @Value("${local.server.port}") - private int port; - - CustomersTestUtils customersTestUtils; - - @PostConstruct - private void init() { - customersTestUtils = new CustomersTestUtils(restTemplate, baseUrl("/customers/")); - } - - @Override - public String baseUrl(String path) { - return "http://localhost:" + port + "/api" + path; - } - - @Override - public CustomersTestUtils getCustomersTestUtils() { - return customersTestUtils; - } - - @Autowired - RestTemplate restTemplate; - - @Override - public RestTemplate getRestTemplate() { - return restTemplate; - } -} diff --git a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebTestConfiguration.java b/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebTestConfiguration.java deleted file mode 100644 index 0de078b..0000000 --- a/java-spring/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/BankingWebTestConfiguration.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.web; - -import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsservice.web.AccountsWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.accountsviewservice.web.AccountViewWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersservice.web.CustomersWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.customersviewservice.web.CustomersViewWebConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web.MoneyTransferWebConfiguration; -import net.chrisrichardson.eventstorestore.javaexamples.testutil.RestTemplateErrorHandler; -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; -import org.springframework.context.annotation.Import; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import java.util.Arrays; -import java.util.List; - -@Configuration -@Import({AccountsWebConfiguration.class, - MoneyTransferWebConfiguration.class, - AccountViewWebConfiguration.class, - CustomersViewWebConfiguration.class, - CustomersWebConfiguration.class, - EmbeddedTestAggregateStoreConfiguration.class, - AuthConfiguration.class}) -@EnableAutoConfiguration -public class BankingWebTestConfiguration extends WebMvcConfigurerAdapter { - - @Bean - public HttpMessageConverters customConverters() { - HttpMessageConverter additional = new MappingJackson2HttpMessageConverter(); - return new HttpMessageConverters(additional); - } - - @Bean - public RestTemplate restTemplate(HttpMessageConverters converters) { - RestTemplate restTemplate = new RestTemplate(); - HttpMessageConverter httpMessageConverter = converters.getConverters().get(0); - List> httpMessageConverters = Arrays.asList(new MappingJackson2HttpMessageConverter()); - restTemplate.setMessageConverters((List>) httpMessageConverters); - - restTemplate.setErrorHandler(new RestTemplateErrorHandler()); - return restTemplate; - } -} diff --git a/java-spring/set-env.sh b/java-spring/set-env.sh deleted file mode 100644 index f84392f..0000000 --- a/java-spring/set-env.sh +++ /dev/null @@ -1,21 +0,0 @@ -if [ -z "$DOCKER_HOST_IP" ] ; then - if [ -z "$DOCKER_HOST" ] ; then - export DOCKER_HOST_IP=`hostname` - else - echo using ${DOCKER_HOST?} - XX=${DOCKER_HOST%\:*} - export DOCKER_HOST_IP=${XX#tcp\:\/\/} - fi -fi - -echo DOCKER_HOST_IP is $DOCKER_HOST_IP - -export SPRING_DATASOURCE_URL=jdbc:mysql://${DOCKER_HOST_IP}/eventuate -export SPRING_DATASOURCE_USERNAME=mysqluser -export SPRING_DATASOURCE_PASSWORD=mysqlpw -export SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver -export EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS=$DOCKER_HOST_IP:9092 -export EVENTUATELOCAL_CDC_DB_USER_NAME=root -export EVENTUATELOCAL_CDC_DB_PASSWORD=rootpassword -export EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING=$DOCKER_HOST_IP:2181 - diff --git a/java-spring/settings.gradle b/java-spring/settings.gradle index 7badf00..0e5ae34 100644 --- a/java-spring/settings.gradle +++ b/java-spring/settings.gradle @@ -1,21 +1,30 @@ include 'testutil' include 'common' -include 'common-backend' include 'common-auth' -include 'common-auth-web' include 'common-swagger' -include 'customers-query-side-common' include 'accounts-service' +include 'accounts-service-api-messaging' +include 'accounts-service-api-web' + include 'accounts-view-service' +include 'accounts-view-service-api-web' + include 'transactions-service' +include 'transactions-service-api-messaging' +include 'transactions-service-api-web' + include 'customers-service' +include 'customers-service-api-messaging' +include 'customers-service-api-web' + include 'customers-view-service' +include 'customers-view-service-api-common' +include 'customers-view-service-api-web' include 'api-gateway-service' +include 'api-gateway-service-api-web' -include 'backend-integration-tests' -include 'rest-api-integration-tests' include 'e2e-test' rootProject.name = 'java-spring-event-sourcing-example' diff --git a/java-spring/testutil/build.gradle b/java-spring/testutil/build.gradle index 5a16a5e..3e5ac8d 100644 --- a/java-spring/testutil/build.gradle +++ b/java-spring/testutil/build.gradle @@ -1,10 +1,14 @@ apply plugin: 'java' dependencies { - compile project(":common") - compile project(":common-auth") + compile project(":accounts-service-api-web") + compile project(":accounts-view-service-api-web") + compile project(":customers-service-api-web") + compile project(":transactions-service-api-web") - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile project(":customers-view-service-api-common") + + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "junit:junit:4.11" diff --git a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractEntityEventTest.java b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractEntityEventTest.java index 2b617e0..693a70a 100644 --- a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractEntityEventTest.java +++ b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractEntityEventTest.java @@ -2,7 +2,7 @@ import io.eventuate.Aggregate; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import io.eventuate.javaclient.spring.EventEntityUtil; +import io.eventuate.javaclient.eventdispatcher.EventEntityUtil; import org.junit.Test; import org.springframework.util.ReflectionUtils; diff --git a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java index e87e23d..689719c 100644 --- a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java +++ b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java @@ -1,10 +1,17 @@ package net.chrisrichardson.eventstorestore.javaexamples.testutil; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.AccountHistoryResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.GetAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.view.webapi.GetAccountsResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountRequest; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.CreateAccountResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.webapi.DeleteAccountResponse; import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.*; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.*; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.CreateMoneyTransferRequest; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.CreateMoneyTransferResponse; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi.CreateMoneyTransferRequest; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi.CreateMoneyTransferResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.webapi.CustomerResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.junit.Assert; import org.junit.Test; import org.springframework.web.client.RestTemplate; @@ -158,7 +165,7 @@ private void assertAccountBalance(AuthenticatedRestTemplate authenticatedRestTem private void assertToAccountsContains(final String customerId, AuthenticatedRestTemplate authenticatedRestTemplate, final ToAccountInfo toAccountInfo) { eventually( () -> CompletableFuture.completedFuture(authenticatedRestTemplate.getForEntity(baseUrl("/customers/" + customerId), - QuerySideCustomer.class)), + CustomerView.class)), customerResponse -> { assertEquals(customerId, customerResponse.getId()); assertTrue(customerResponse.getToAccounts().values().stream().anyMatch(t -> t.equals(toAccountInfo))); diff --git a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java index 25eaeae..763f408 100644 --- a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java +++ b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstorestore.javaexamples.testutil; import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.*; -import net.chrisrichardson.eventstore.javaexamples.banking.web.customers.queryside.common.QuerySideCustomer; +import net.chrisrichardson.eventstore.javaexamples.banking.customers.view.commonapi.CustomerView; import org.junit.Assert; import org.springframework.web.client.RestTemplate; @@ -22,19 +22,19 @@ public CustomersTestUtils(RestTemplate restTemplate, String customersBaseUrl) { public void assertCustomerResponse(final String customerId, final CustomerInfo customerInfo) { AuthenticatedRestTemplate art = new AuthenticatedRestTemplate(restTemplate, customerInfo.getUserCredentials()); eventually( - () -> CompletableFuture.completedFuture(art.getForEntity(customersBaseUrl + customerId, QuerySideCustomer.class)), + () -> CompletableFuture.completedFuture(art.getForEntity(customersBaseUrl + customerId, CustomerView.class)), querySideCustomer -> { Assert.assertEquals(customerId, querySideCustomer.getId()); assertQuerySideCustomerEqualscCustomerInfo(querySideCustomer, customerInfo); }); } - public void assertQuerySideCustomerEqualscCustomerInfo(QuerySideCustomer querySideCustomer, CustomerInfo customerInfo) { - Assert.assertEquals(querySideCustomer.getName(), customerInfo.getName()); - Assert.assertEquals(querySideCustomer.getEmail(), customerInfo.getUserCredentials().getEmail()); - Assert.assertEquals(querySideCustomer.getPhoneNumber(), customerInfo.getPhoneNumber()); - Assert.assertEquals(querySideCustomer.getSsn(), customerInfo.getSsn()); - Assert.assertEquals(querySideCustomer.getAddress(), customerInfo.getAddress()); + public void assertQuerySideCustomerEqualscCustomerInfo(CustomerView customerView, CustomerInfo customerInfo) { + Assert.assertEquals(customerView.getName(), customerInfo.getName()); + Assert.assertEquals(customerView.getEmail(), customerInfo.getUserCredentials().getEmail()); + Assert.assertEquals(customerView.getPhoneNumber(), customerInfo.getPhoneNumber()); + Assert.assertEquals(customerView.getSsn(), customerInfo.getSsn()); + Assert.assertEquals(customerView.getAddress(), customerInfo.getAddress()); } public static CustomerInfo generateCustomerInfo() { diff --git a/java-spring/transactions-service-api-messaging/build.gradle b/java-spring/transactions-service-api-messaging/build.gradle new file mode 100644 index 0000000..3e5f28d --- /dev/null +++ b/java-spring/transactions-service-api-messaging/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") + + compile "io.eventuate.local.java:eventuate-client-java-spring:$eventuateLocalVersion" +} diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/CreditRecordedEvent.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/CreditRecordedEvent.java similarity index 76% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/CreditRecordedEvent.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/CreditRecordedEvent.java index eebddbd..4d2df97 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/CreditRecordedEvent.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/CreditRecordedEvent.java @@ -1,5 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; - +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; public class CreditRecordedEvent extends MoneyTransferEvent { private TransferDetails details; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/DebitRecordedEvent.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/DebitRecordedEvent.java similarity index 76% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/DebitRecordedEvent.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/DebitRecordedEvent.java index e0fd751..2443f57 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/DebitRecordedEvent.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/DebitRecordedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; public class DebitRecordedEvent extends MoneyTransferEvent { private TransferDetails details; diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/FailedDebitRecordedEvent.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/FailedDebitRecordedEvent.java similarity index 77% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/FailedDebitRecordedEvent.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/FailedDebitRecordedEvent.java index 1a089e6..201964f 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/FailedDebitRecordedEvent.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/FailedDebitRecordedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; public class FailedDebitRecordedEvent extends MoneyTransferEvent { diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferCreatedEvent.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferCreatedEvent.java similarity index 77% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferCreatedEvent.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferCreatedEvent.java index a09759b..f971b6e 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferCreatedEvent.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferCreatedEvent.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; public class MoneyTransferCreatedEvent extends MoneyTransferEvent { diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferEvent.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferEvent.java similarity index 56% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferEvent.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferEvent.java index 244166b..7148d28 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/MoneyTransferEvent.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/MoneyTransferEvent.java @@ -1,8 +1,8 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; import io.eventuate.Event; import io.eventuate.EventEntity; -@EventEntity(entity="net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransfer") +@EventEntity(entity="net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransfer") public abstract class MoneyTransferEvent implements Event { } diff --git a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/TransferDetails.java b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/TransferDetails.java similarity index 82% rename from java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/TransferDetails.java rename to java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/TransferDetails.java index 169d7ee..53e48fe 100644 --- a/java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/TransferDetails.java +++ b/java-spring/transactions-service-api-messaging/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/domain/events/TransferDetails.java @@ -1,9 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; - -/* -case class TransferDetails(fromAccountId : EntityIdentifier, toAccountId : EntityIdentifier, amount : BigDecimal) - */ - +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events; import java.math.BigDecimal; import java.util.Date; diff --git a/java-spring/transactions-service-api-web/build.gradle b/java-spring/transactions-service-api-web/build.gradle new file mode 100644 index 0000000..7e5f160 --- /dev/null +++ b/java-spring/transactions-service-api-web/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java' + +dependencies { + compile project(":common") +} diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferRequest.java b/java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferRequest.java similarity index 93% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferRequest.java rename to java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferRequest.java index f82937e..4880c84 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferRequest.java +++ b/java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferRequest.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi; import javax.validation.constraints.DecimalMin; import javax.validation.constraints.NotNull; diff --git a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferResponse.java b/java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferResponse.java similarity index 79% rename from java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferResponse.java rename to java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferResponse.java index dfb55be..00e35d0 100644 --- a/java-spring/common/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/common/transactions/CreateMoneyTransferResponse.java +++ b/java-spring/transactions-service-api-web/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactions/webapi/CreateMoneyTransferResponse.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.common.transactions; +package net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi; public class CreateMoneyTransferResponse { diff --git a/java-spring/transactions-service/Dockerfile b/java-spring/transactions-service/Dockerfile index b75309e..54a70f3 100644 --- a/java-spring/transactions-service/Dockerfile +++ b/java-spring/transactions-service/Dockerfile @@ -1,4 +1,3 @@ -FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar transactions-service.jar -EXPOSE 8080 -COPY build/libs/transactions-service.jar . \ No newline at end of file +ARG baseImageVersion +FROM eventuateio/eventuate-examples-docker-images-spring-example-base-image:$baseImageVersion +COPY build/libs/transactions-service.jar service.jar diff --git a/java-spring/transactions-service/build.gradle b/java-spring/transactions-service/build.gradle index ccc4a03..c7a9413 100644 --- a/java-spring/transactions-service/build.gradle +++ b/java-spring/transactions-service/build.gradle @@ -1,22 +1,20 @@ -apply plugin: 'spring-boot' -apply plugin: EventuateDependencyPlugin - -apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: 'org.springframework.boot' dependencies { - compile project(":common-backend") compile project(":common-swagger") + compile project(":transactions-service-api-messaging") + compile project(":transactions-service-api-web") + compile project(":accounts-service-api-messaging") + + compile "io.eventuate.local.java:eventuate-local-java-spring-jdbc:$eventuateLocalVersion" + compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" + compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" testCompile project(":testutil") testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" + testCompile "io.eventuate.local.java:eventuate-client-java-spring-jdbc:$eventuateLocalVersion" } - -test { - ignoreFailures System.getenv("EVENTUATE_API_KEY_ID") == null -} - diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferBackendConfiguration.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/MoneyTransferConfiguration.java similarity index 65% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferBackendConfiguration.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/MoneyTransferConfiguration.java index 5ebebcc..668b9e1 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferBackendConfiguration.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/MoneyTransferConfiguration.java @@ -1,14 +1,18 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice; import io.eventuate.AggregateRepository; import io.eventuate.EventuateAggregateStore; import io.eventuate.javaclient.spring.EnableEventHandlers; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransfer; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransferCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service.MoneyTransferService; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service.MoneyTransferWorkflow; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @EnableEventHandlers -public class MoneyTransferBackendConfiguration { +public class MoneyTransferConfiguration { @Bean public MoneyTransferService moneyTransferService(AggregateRepository moneyTransferRepository) { diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsServiceMain.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsServiceMain.java index 4c7be34..0159f02 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsServiceMain.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsServiceMain.java @@ -1,7 +1,6 @@ package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice; -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import io.eventuate.local.java.spring.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web.MoneyTransferWebConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -10,9 +9,9 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({MoneyTransferWebConfiguration.class, - EventuateDriverConfiguration.class, - CommonSwaggerConfiguration.class}) +@Import({MoneyTransferConfiguration.class, + MoneyTransferWebConfiguration.class, + EventuateDriverConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class TransactionsServiceMain { diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/CreateMoneyTransferCommand.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/CreateMoneyTransferCommand.java similarity index 72% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/CreateMoneyTransferCommand.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/CreateMoneyTransferCommand.java index e5cb1f4..0049f23 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/CreateMoneyTransferCommand.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/CreateMoneyTransferCommand.java @@ -1,6 +1,7 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.TransferDetails; + +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.TransferDetails; public class CreateMoneyTransferCommand implements MoneyTransferCommand { private TransferDetails details; diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransfer.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransfer.java similarity index 73% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransfer.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransfer.java index eb31f04..ede74e3 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransfer.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransfer.java @@ -1,10 +1,14 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; import io.eventuate.Event; import io.eventuate.EventUtil; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.*; import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.CreditRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.DebitRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.FailedDebitRecordedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.MoneyTransferCreatedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.TransferDetails; import java.util.List; diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferCommand.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransferCommand.java similarity index 54% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferCommand.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransferCommand.java index 64b3819..4b0abd2 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferCommand.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/MoneyTransferCommand.java @@ -1,6 +1,6 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; import io.eventuate.Command; -interface MoneyTransferCommand extends Command { +public interface MoneyTransferCommand extends Command { } diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordCreditCommand.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordCreditCommand.java similarity index 84% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordCreditCommand.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordCreditCommand.java index 015ce28..3bad2b2 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordCreditCommand.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordCreditCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; public class RecordCreditCommand implements MoneyTransferCommand { } diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitCommand.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitCommand.java similarity index 84% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitCommand.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitCommand.java index e4be904..f85bfbc 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitCommand.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; public class RecordDebitCommand implements MoneyTransferCommand { } diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitFailedCommand.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitFailedCommand.java similarity index 84% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitFailedCommand.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitFailedCommand.java index 559e574..26a3270 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/RecordDebitFailedCommand.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/domain/RecordDebitFailedCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain; public class RecordDebitFailedCommand implements MoneyTransferCommand { } diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferService.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferService.java similarity index 60% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferService.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferService.java index c0209da..c512def 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferService.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferService.java @@ -1,8 +1,11 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service; import io.eventuate.AggregateRepository; import io.eventuate.EntityWithIdAndVersion; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.TransferDetails; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.TransferDetails; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.CreateMoneyTransferCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransfer; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransferCommand; import java.util.concurrent.CompletableFuture; diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferWorkflow.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferWorkflow.java similarity index 59% rename from java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferWorkflow.java rename to java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferWorkflow.java index a6724a4..d102787 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferWorkflow.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferWorkflow.java @@ -1,13 +1,17 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service; import io.eventuate.EntityWithIdAndVersion; import io.eventuate.EventHandlerContext; import io.eventuate.EventHandlerMethod; import io.eventuate.EventSubscriber; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountCreditedEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountDebitFailedDueToInsufficientFundsEvent; -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.accounts.AccountDebitedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountCreditedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDebitFailedDueToInsufficientFundsEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.accounts.domain.events.AccountDebitedEvent; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransfer; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.RecordCreditCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.RecordDebitCommand; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.RecordDebitFailedCommand; import java.util.concurrent.CompletableFuture; diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferController.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferController.java index df2cb80..fae84c7 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferController.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferController.java @@ -1,10 +1,9 @@ package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web; - -import net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions.TransferDetails; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.CreateMoneyTransferRequest; -import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.CreateMoneyTransferResponse; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferService; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi.CreateMoneyTransferRequest; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.webapi.CreateMoneyTransferResponse; +import net.chrisrichardson.eventstore.javaexamples.banking.transactions.domain.events.TransferDetails; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service.MoneyTransferService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; diff --git a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferWebConfiguration.java b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferWebConfiguration.java index 643bbe7..95572c5 100644 --- a/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferWebConfiguration.java +++ b/java-spring/transactions-service/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferWebConfiguration.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web; -import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend.MoneyTransferBackendConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import net.chrisrichardson.eventstore.javaexamples.banking.commonswagger.CommonSwaggerConfiguration; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -10,7 +10,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({MoneyTransferBackendConfiguration.class}) +@Import({CommonSwaggerConfiguration.class}) @ComponentScan public class MoneyTransferWebConfiguration { diff --git a/java-spring/transactions-service/src/main/resources/application.properties b/java-spring/transactions-service/src/main/resources/application.properties new file mode 100644 index 0000000..7c2c49c --- /dev/null +++ b/java-spring/transactions-service/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/eventuate +spring.datasource.username=mysqluser +spring.datasource.password=mysqlpw +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 diff --git a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceIntegrationTest.java b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceIntegrationTest.java index 14a0e7b..de6068f 100644 --- a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceIntegrationTest.java +++ b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceIntegrationTest.java @@ -3,20 +3,16 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.client.RestTemplate; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = TransactionsCommandSideServiceTestConfiguration.class) -@WebAppConfiguration -@IntegrationTest({"server.port=0", "management.port=0"}) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = TransactionsCommandSideServiceTestConfiguration.class) public class TransactionsCommandSideServiceIntegrationTest { - @Value("${local.server.port}") + @LocalServerPort private int port; private String baseUrl(String path) { diff --git a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceTestConfiguration.java b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceTestConfiguration.java index 70182ef..57f9f3d 100644 --- a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceTestConfiguration.java +++ b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/TransactionsCommandSideServiceTestConfiguration.java @@ -2,7 +2,7 @@ import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web.MoneyTransferWebConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.web.HttpMessageConverters; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -14,7 +14,7 @@ import java.util.List; @Configuration -@Import(MoneyTransferWebConfiguration.class) +@Import({MoneyTransferConfiguration.class, MoneyTransferWebConfiguration.class}) @EnableAutoConfiguration public class TransactionsCommandSideServiceTestConfiguration { diff --git a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferEventTest.java b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferEventTest.java similarity index 71% rename from java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferEventTest.java rename to java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferEventTest.java index 58cd9f9..1f3c36d 100644 --- a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/backend/MoneyTransferEventTest.java +++ b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/service/MoneyTransferEventTest.java @@ -1,5 +1,6 @@ -package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.backend; +package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.service; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.domain.MoneyTransfer; import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractEntityEventTest; public class MoneyTransferEventTest extends AbstractEntityEventTest { diff --git a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTest.java b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTest.java index f6931bc..ccd15b7 100644 --- a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTest.java +++ b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTest.java @@ -5,8 +5,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -19,8 +18,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = MoneyTransferControllerIntegrationTestConfiguration.class) -@IntegrationTest +@SpringBootTest(classes = MoneyTransferControllerIntegrationTestConfiguration.class) @WebAppConfiguration public class MoneyTransferControllerIntegrationTest { diff --git a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTestConfiguration.java b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTestConfiguration.java index da8a456..71d8481 100644 --- a/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTestConfiguration.java +++ b/java-spring/transactions-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/transactionsservice/web/MoneyTransferControllerIntegrationTestConfiguration.java @@ -1,12 +1,15 @@ package net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.web; import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; +import net.chrisrichardson.eventstore.javaexamples.banking.transactionsservice.MoneyTransferConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({MoneyTransferWebConfiguration.class, EmbeddedTestAggregateStoreConfiguration.class}) +@Import({MoneyTransferConfiguration.class, + MoneyTransferWebConfiguration.class, + EmbeddedTestAggregateStoreConfiguration.class}) @EnableAutoConfiguration public class MoneyTransferControllerIntegrationTestConfiguration { } diff --git a/scala-spring/README.md b/scala-spring/README.md deleted file mode 100644 index 234fe74..0000000 --- a/scala-spring/README.md +++ /dev/null @@ -1,37 +0,0 @@ -This is the Scala/Spring version of the Event Sourcing/CQRS money transfer example application. - -# About the application - -This application consists of three microservices: - - * Account Service - the command side business logic for Accounts - * Money Transfer Service - the command side business logic for Money Transfers - * Query service - query side implementation of a MongoDB-based, denormalized view of Accounts and MoneyTransfers - -The Account Service consists of the following modules: - - * accounts-command-side-backend - the Account aggregate - * accounts-command-side-web - a REST API for creating and retrieving Accounts - * accounts-command-side-service - a standalone microservice - -The Money Transfer Service consists of the following modules: - - * transactions-command-side-backend - the MoneyTransfer aggregate - * transactions-command-side-web - a REST API for creating and retrieving Money Transfers - * transactions-command-side-service - a standalone microservice - -The Query Service consists the following modules: - - * accounts-query-side-backend - MongoDB-based, denormalized view of Accounts and MoneyTransfers - * accounts-query-side-web - a REST API for querying the denormalized view - * accounts-query-side-service - a standalone microservice - -# Deploying the application - -These services can be deployed either as either separate standalone services using the Event Store server, or they can be deployed as a monolithic application for simpified integration testing. - -The three services can also be packaged as a single monolithic web application in order to be used with the embedded Event Store: - - * monolithic-service - all-in-one, monolithic packaging of the application - - diff --git a/scala-spring/accounts-command-side-backend/build.gradle b/scala-spring/accounts-command-side-backend/build.gradle deleted file mode 100644 index 222d391..0000000 --- a/scala-spring/accounts-command-side-backend/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":common-backend") - compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion" -} diff --git a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/Account.scala b/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/Account.scala deleted file mode 100644 index 5f71c80..0000000 --- a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/Account.scala +++ /dev/null @@ -1,41 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.accounts - -import net.chrisrichardson.eventstore.PatternMatchingCommandProcessingAggregate -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountCommands.{DebitAccountCommand, AccountCommand, CreditAccountCommand, OpenAccountCommand} -import net.chrisrichardson.eventstore.examples.bank.backend.common.accounts.{AccountCreditedEvent, AccountDebitFailedDueToInsufficientFundsEvent, AccountDebitedEvent, AccountOpenedEvent} - -case class Account(balance : BigDecimal) - extends PatternMatchingCommandProcessingAggregate[Account, AccountCommand] { - - def this() = this(null) - - - def processCommand = { - case OpenAccountCommand(initialBalance) => - Seq(AccountOpenedEvent(initialBalance)) - - case CreditAccountCommand(amount, transactionId) => - Seq(AccountCreditedEvent(amount, transactionId)) - - case DebitAccountCommand(amount, transactionId) if amount <= balance => - Seq(AccountDebitedEvent(amount, transactionId)) - - case DebitAccountCommand(amount, transactionId) => - Seq(AccountDebitFailedDueToInsufficientFundsEvent(amount, transactionId)) - } - - def applyEvent = { - - case AccountOpenedEvent(initialBalance) => copy(balance = initialBalance) - - case AccountDebitedEvent(amount, _) => copy(balance = balance - amount) - - case AccountCreditedEvent(amount, _) => - copy(balance = balance + amount) - - case AccountDebitFailedDueToInsufficientFundsEvent(amount, _) => - this - - } - -} diff --git a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountCommands.scala b/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountCommands.scala deleted file mode 100644 index 336becd..0000000 --- a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountCommands.scala +++ /dev/null @@ -1,13 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.accounts - -import net.chrisrichardson.eventstore.{Command, EntityId} - -object AccountCommands { - - sealed trait AccountCommand extends Command - - case class OpenAccountCommand(initialBalance : BigDecimal) extends AccountCommand - case class DebitAccountCommand(amount : BigDecimal, transactionId : EntityId) extends AccountCommand - case class CreditAccountCommand(amount : BigDecimal, transactionId : EntityId) extends AccountCommand - -} diff --git a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountConfiguration.scala b/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountConfiguration.scala deleted file mode 100644 index 7dd00c9..0000000 --- a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountConfiguration.scala +++ /dev/null @@ -1,21 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.accounts - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.subscriptions.EnableEventHandlers -import net.chrisrichardson.utils.config.MetricRegistryConfiguration -import org.springframework.context.annotation.{Bean, Configuration, Import} - -@Configuration -@Import(Array(classOf[MetricRegistryConfiguration])) -@EnableEventHandlers -class AccountConfiguration { - - @Bean - def accountService(eventStore : EventStore) = new AccountService()(eventStore) - - - @Bean - def transferWorkflow(eventStore: EventStore): TransferWorkflowAccountHandlers = { - new TransferWorkflowAccountHandlers(eventStore) - } -} diff --git a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountService.scala b/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountService.scala deleted file mode 100644 index 9cbe3ce..0000000 --- a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/AccountService.scala +++ /dev/null @@ -1,12 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.accounts - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountCommands.OpenAccountCommand -import net.chrisrichardson.eventstore.util.ServiceUtil._ - -class AccountService(implicit eventStore : EventStore) { - - def openAccount(initialBalance : BigDecimal) = - newEntity[Account] <== OpenAccountCommand(initialBalance) - -} diff --git a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/TransferWorkflowAccountHandlers.scala b/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/TransferWorkflowAccountHandlers.scala deleted file mode 100644 index 8ac21ea..0000000 --- a/scala-spring/accounts-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/accounts/TransferWorkflowAccountHandlers.scala +++ /dev/null @@ -1,27 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.accounts - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountCommands.{CreditAccountCommand, DebitAccountCommand} -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.{DebitRecordedEvent, MoneyTransferCreatedEvent} -import net.chrisrichardson.eventstore.subscriptions.{EventHandlerMethod, CompoundEventHandler, EventSubscriber} -import net.chrisrichardson.eventstore.util.EventHandlingUtil._ - -@EventSubscriber(id = "accountEventHandlers") -class TransferWorkflowAccountHandlers(eventStore: EventStore) extends CompoundEventHandler { - - implicit val es = eventStore - - @EventHandlerMethod - val performDebit = - handlerForEvent[MoneyTransferCreatedEvent] { de => - existingEntity[Account](de.event.details.fromAccountId) <== - DebitAccountCommand(de.event.details.amount, de.entityId) - } - - @EventHandlerMethod - val performCredit = handlerForEvent[DebitRecordedEvent] { de => - existingEntity[Account](de.event.details.toAccountId) <== - CreditAccountCommand(de.event.details.amount, de.entityId) - } - -} diff --git a/scala-spring/accounts-command-side-service/build.gradle b/scala-spring/accounts-command-side-service/build.gradle deleted file mode 100644 index 2ae2454..0000000 --- a/scala-spring/accounts-command-side-service/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -apply plugin: 'scala' -apply plugin: 'spring-boot' -apply plugin: VerifyEventStoreEnvironmentPlugin - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":accounts-command-side-web") - - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" - - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" - - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile scalaTestDependency - -} - -test { - ignoreFailures true -} - diff --git a/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceConfiguration.scala b/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceConfiguration.scala deleted file mode 100644 index 13d33a4..0000000 --- a/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceConfiguration.scala +++ /dev/null @@ -1,25 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.accounts.CommandSideWebAccountsConfiguration -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.web.HttpMessageConverters -import org.springframework.context.annotation._ -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter - -@Configuration -@EnableAutoConfiguration -@Import(Array(classOf[CommandSideWebAccountsConfiguration], classOf[EventStoreHttpClientConfiguration])) -@ComponentScan -class AccountsCommandSideServiceConfiguration { - - @Bean - def scalaJSonConverter: HttpMessageConverters = { - val additional = new MappingJackson2HttpMessageConverter - additional.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - new HttpMessageConverters(additional) - } - - -} diff --git a/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsCommandSideServiceMain.scala b/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsCommandSideServiceMain.scala deleted file mode 100644 index c10e188..0000000 --- a/scala-spring/accounts-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsCommandSideServiceMain.scala +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.main - -import net.chrisrichardson.eventstore.examples.bank.web.AccountsCommandSideServiceConfiguration -import org.springframework.boot.SpringApplication - -object AccountsCommandSideServiceMain { - - def main(args: Array[String]) : Unit = SpringApplication.run(classOf[AccountsCommandSideServiceConfiguration], args :_ *) - -} diff --git a/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceIntegrationTest.scala b/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceIntegrationTest.scala deleted file mode 100644 index 0fbe451..0000000 --- a/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceIntegrationTest.scala +++ /dev/null @@ -1,32 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers.{CreateAccountRequest, CreateAccountResponse} -import org.junit.Assert -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.springframework.boot.SpringApplication -import org.springframework.web.client.RestTemplate - -@RunWith(classOf[JUnitRunner]) -class AccountsCommandSideServiceIntegrationTest extends FlatSpec { - - val sa = new SpringApplication(classOf[AccountsCommandSideServiceTestConfiguration]) - val ctx = sa.run() - - // var server = ctx.getBean(classOf[EmbeddedServletContainer]) - - val port = 8080 - - val baseUrl = s"http://localhost:$port/" - - val restTemplate = ctx.getBean(classOf[RestTemplate]) - - it should "create account" in { - - val CreateAccountResponse(accountId) = restTemplate.postForEntity(s"$baseUrl/accounts", CreateAccountRequest(BigDecimal(500)), classOf[CreateAccountResponse]).getBody - Assert.assertNotNull(accountId) - - } - -} diff --git a/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceTestConfiguration.scala b/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceTestConfiguration.scala deleted file mode 100644 index ec570c1..0000000 --- a/scala-spring/accounts-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsCommandSideServiceTestConfiguration.scala +++ /dev/null @@ -1,27 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - - -import com.fasterxml.jackson.databind.ObjectMapper -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.context.annotation.{Bean, Import, Configuration} -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter -import org.springframework.web.client.RestTemplate -import scala.collection.JavaConversions._ - -@Configuration -@Import(Array(classOf[AccountsCommandSideServiceConfiguration])) -class AccountsCommandSideServiceTestConfiguration { - - @Bean - def restTemplate() = { - val restTemplate = new RestTemplate() - restTemplate.getMessageConverters foreach { - case mc: MappingJackson2HttpMessageConverter => - mc.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - case _ => - } - restTemplate - } - -} diff --git a/scala-spring/accounts-command-side-web/build.gradle b/scala-spring/accounts-command-side-web/build.gradle deleted file mode 100644 index 827fd7c..0000000 --- a/scala-spring/accounts-command-side-web/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'scala' - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":accounts-command-side-backend") - compile project(":common-web") - - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile scalaTestDependency -} diff --git a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/CommandSideWebAccountsConfiguration.scala b/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/CommandSideWebAccountsConfiguration.scala deleted file mode 100644 index 6575269..0000000 --- a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/CommandSideWebAccountsConfiguration.scala +++ /dev/null @@ -1,11 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.accounts - -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountConfiguration -import org.springframework.context.annotation.{ComponentScan, Configuration, Import} - -@Configuration -@Import(Array(classOf[AccountConfiguration])) -@ComponentScan -class CommandSideWebAccountsConfiguration { - -} diff --git a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/AccountController.scala b/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/AccountController.scala deleted file mode 100644 index f346862..0000000 --- a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/AccountController.scala +++ /dev/null @@ -1,20 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountService -import net.chrisrichardson.eventstore.examples.bank.web.util.WebUtil -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.web.bind.annotation._ -import scala.concurrent.ExecutionContext.Implicits.global - - -@RestController -class AccountController @Autowired() (accountService : AccountService, eventStore : EventStore) { - - @RequestMapping(value=Array("/accounts"), method = Array(RequestMethod.POST)) - def create(@RequestBody request : CreateAccountRequest) = { - val f = accountService.openAccount(request.initialBalance) - WebUtil.toDeferredResult(f map(account => CreateAccountResponse(account.entityId.id))) - - } -} diff --git a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountRequest.scala b/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountRequest.scala deleted file mode 100644 index 0e1b602..0000000 --- a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountRequest.scala +++ /dev/null @@ -1,3 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers - -case class CreateAccountRequest(initialBalance : BigDecimal) diff --git a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountResponse.scala b/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountResponse.scala deleted file mode 100644 index 6177f5b..0000000 --- a/scala-spring/accounts-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/accounts/controllers/CreateAccountResponse.scala +++ /dev/null @@ -1,7 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers - -/** - * Created by cer on 7/16/14. - */ -case class CreateAccountResponse(accountId : String) -case class GetAccountResponse(accountId : String, balance : String) diff --git a/scala-spring/accounts-query-side-backend/build.gradle b/scala-spring/accounts-query-side-backend/build.gradle deleted file mode 100644 index 7bc4f51..0000000 --- a/scala-spring/accounts-query-side-backend/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'scala' - -dependencies { - - compile project(":common-backend") - - compile "org.scala-lang:scala-library:2.10.2" - compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" - - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - - testCompile scalaTestDependency - - testCompile "junit:junit:4.11" - testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion" -} diff --git a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfo.scala b/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfo.scala deleted file mode 100644 index 1f32c37..0000000 --- a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfo.scala +++ /dev/null @@ -1,14 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.queryside - -import org.springframework.data.mongodb.repository.MongoRepository - -case class AccountInfo(id : String, balance : Long, - changes : java.util.List[AccountChangeInfo], - transactions : java.util.List[AccountTransactionInfo], - version : String) - -case class AccountChangeInfo(changeId : String, transactionId : String, transactionType : String, amount : Long, balanceDelta: Long) - -case class AccountTransactionInfo(transactionId : String, fromAccountId: String, toAccountId: String, amount : Long) - -trait AccountInfoRepository extends MongoRepository[AccountInfo, String] \ No newline at end of file diff --git a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoQueryService.scala b/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoQueryService.scala deleted file mode 100644 index b8e1f3f..0000000 --- a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoQueryService.scala +++ /dev/null @@ -1,17 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.queryside - -import net.chrisrichardson.eventstore.EntityId - -class AccountInfoQueryService(accountInfoRepository : AccountInfoRepository) { - - def findByAccountId(accountId : EntityId) : AccountInfo = { - val account = accountInfoRepository.findOne(accountId.id) - if (account == null) - throw new AccountNotFoundException(accountId) - else - account - } - -} - -class AccountNotFoundException(accountId : EntityId) extends RuntimeException("Account not found " + accountId) \ No newline at end of file diff --git a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoUpdateService.scala b/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoUpdateService.scala deleted file mode 100644 index ebb5394..0000000 --- a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/AccountInfoUpdateService.scala +++ /dev/null @@ -1,95 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.queryside - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.Event -import net.chrisrichardson.eventstore.Event.EventId -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.MoneyTransferCreatedEvent -import net.chrisrichardson.eventstore.examples.bank._ -import net.chrisrichardson.eventstore.examples.bank.backend.common.accounts._ -import net.chrisrichardson.eventstore.subscriptions.{EventSubscriber, DispatchedEvent, EventHandlerMethod, CompoundEventHandler} -import net.chrisrichardson.eventstore.util.ServiceUtil._ -import net.chrisrichardson.utils.logging.Logging -import org.springframework.data.mongodb.core.MongoTemplate - -import scala.collection.JavaConversions._ - -import org.springframework.data.mongodb.core.query.Criteria.where -import org.springframework.data.mongodb.core.query.Query -import org.springframework.data.mongodb.core.query.Update -import scala.concurrent.ExecutionContext.Implicits.global - -import scala.concurrent.Future - -@EventSubscriber (id = "querySideEventHandlers") -class AccountInfoUpdateService(accountInfoRepository : AccountInfoRepository, mongoTemplate : MongoTemplate) extends CompoundEventHandler with Logging { - - - @EventHandlerMethod - def created(de: DispatchedEvent[AccountOpenedEvent]) = Future { - logger.info("About to save") - try { - - if (de.event.initialBalance != null) - accountInfoRepository.save(AccountInfo(de.entityId.id, toIntegerRepr(de.event.initialBalance), Seq(), Seq(), de.eventId.asString)) - else - logger.error("Event with initialBalance == null {}", de.entityId) - } - catch { - case t : Throwable => - logger.error("Error during saving: ") - logger.error("Error during saving: ", t) - throw t - } - logger.info("Saved in mongo") - } - - @EventHandlerMethod - def recordDebit(de: DispatchedEvent[AccountDebitedEvent]) = saveChange(de, -1) - - @EventHandlerMethod - def recordCredit(de: DispatchedEvent[AccountCreditedEvent]) = saveChange(de, +1) - - @EventHandlerMethod - def recordDebitFailed(de: DispatchedEvent[AccountDebitFailedDueToInsufficientFundsEvent]) = saveChange(de, 0) - - def toIntegerRepr(d : BigDecimal) = (d * 100).toLong - def saveChange[T <: AccountChangedEvent](de : DispatchedEvent[T], delta : Int) = Future { - val changeId = de.eventId.asString - val transactionId = de.event.transactionId.id - val amount = toIntegerRepr(de.event.amount) - - val ci= AccountChangeInfo(changeId, transactionId, de.event.getClass.getSimpleName, amount, amount * delta) - - mongoTemplate.updateMulti(new Query(where("id").is(de.entityId.id).and("version").lt(changeId)), - new Update(). - inc("balance", amount * delta). - push("changes", ci). - set("version", changeId), - classOf[AccountInfo]) - } - - @EventHandlerMethod - def recordTransfer(de: DispatchedEvent[MoneyTransferCreatedEvent]) = Future { - val eventId = de.eventId.asString - val fromAccountId = de.event.details.fromAccountId.id - val toAccountId = de.event.details.toAccountId.id - - val ti = AccountTransactionInfo(de.entityId.id, fromAccountId, toAccountId, toIntegerRepr(de.event.details.amount)) - - mongoTemplate.updateMulti(new Query(where("id").is(fromAccountId).and("version").lt(eventId)), - new Update(). - push("transactions", ti). - set("version", eventId), - classOf[AccountInfo]) - - mongoTemplate.updateMulti(new Query(where("id").is(toAccountId).and("version").lt(eventId)), - new Update(). - push("transactions", ti). - set("version", eventId), - classOf[AccountInfo]) - - } - - - -} diff --git a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerySideConfiguration.scala b/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerySideConfiguration.scala deleted file mode 100644 index ff2c4ba..0000000 --- a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerySideConfiguration.scala +++ /dev/null @@ -1,20 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.queryside - -import org.springframework.context.annotation.{Bean, Configuration} -import org.springframework.data.mongodb.core.MongoTemplate -import org.springframework.data.mongodb.repository.config.EnableMongoRepositories - -@Configuration -@EnableMongoRepositories -class QuerySideConfiguration { - - @Bean - def accountUpdateService(accountInfoRepository: AccountInfoRepository, mongoTemplate: MongoTemplate): AccountInfoUpdateService = - new AccountInfoUpdateService(accountInfoRepository, mongoTemplate) - - @Bean - def accountInfoQueryService(accountInfoRepository : AccountInfoRepository) = new AccountInfoQueryService(accountInfoRepository) - - @Bean - def querysideDependencyChecker(mongoTemplate : MongoTemplate) = new QuerysideDependencyChecker(mongoTemplate) -} diff --git a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerysideDependencyChecker.scala b/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerysideDependencyChecker.scala deleted file mode 100644 index 2c37f90..0000000 --- a/scala-spring/accounts-query-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/queryside/QuerysideDependencyChecker.scala +++ /dev/null @@ -1,26 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.queryside - -import javax.annotation.PostConstruct - -import net.chrisrichardson.utils.logging.Logging -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.data.mongodb.core.MongoTemplate - -import scala.concurrent.{TimeoutException, Await, Future} -import scala.concurrent.duration._ -import scala.concurrent.ExecutionContext.Implicits.global - -class QuerysideDependencyChecker (mongoTemplate : MongoTemplate) extends Logging { - - @PostConstruct - def checkDependencies(): Unit = { - try { - Await.result(Future { mongoTemplate.getDb.getCollectionNames}, 5 seconds) - } catch { - case e : Throwable => - logger.error("Error connecting to Mongo - have you set SPRING_DATA_MONGODB_URI or --spring.data.mongodb_uri?", e) - throw e - } - } - -} diff --git a/scala-spring/accounts-query-side-service/build.gradle b/scala-spring/accounts-query-side-service/build.gradle deleted file mode 100644 index c650557..0000000 --- a/scala-spring/accounts-query-side-service/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: 'scala' -apply plugin: 'spring-boot' -apply plugin: VerifyMongoDBConfigurationPlugin -apply plugin: VerifyEventStoreEnvironmentPlugin - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":accounts-query-side-web") - - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" - - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" - - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile scalaTestDependency - -} - -test { - ignoreFailures true -} - diff --git a/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceConfiguration.scala b/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceConfiguration.scala deleted file mode 100644 index 396829b..0000000 --- a/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceConfiguration.scala +++ /dev/null @@ -1,24 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.queryside.QuerySideWebConfiguration -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.web.HttpMessageConverters -import org.springframework.context.annotation._ -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter - -@Configuration -@EnableAutoConfiguration -@Import(Array(classOf[QuerySideWebConfiguration], classOf[EventStoreHttpClientConfiguration])) -@ComponentScan -class AccountsQuerySideServiceConfiguration { - - @Bean - def scalaJSonConverter: HttpMessageConverters = { - val additional = new MappingJackson2HttpMessageConverter - additional.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - new HttpMessageConverters(additional) - } - -} diff --git a/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsQuerySideServiceMain.scala b/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsQuerySideServiceMain.scala deleted file mode 100644 index 4be2004..0000000 --- a/scala-spring/accounts-query-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/AccountsQuerySideServiceMain.scala +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.main - -import net.chrisrichardson.eventstore.examples.bank.web.AccountsQuerySideServiceConfiguration -import org.springframework.boot.SpringApplication - -object AccountsQuerySideServiceMain { - - def main(args: Array[String]) : Unit = SpringApplication.run(classOf[AccountsQuerySideServiceConfiguration], args :_ *) - -} diff --git a/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceIntegrationTest.scala b/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceIntegrationTest.scala deleted file mode 100644 index 8c8b66d..0000000 --- a/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceIntegrationTest.scala +++ /dev/null @@ -1,30 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.concurrent.Eventually._ -import org.scalatest.junit.JUnitRunner -import org.scalatest.time.{Millis, Span} -import org.springframework.boot.SpringApplication -import org.springframework.web.client.RestTemplate - -@RunWith(classOf[JUnitRunner]) -class AccountsQuerySideServiceIntegrationTest extends FlatSpec { - - val sa = new SpringApplication(classOf[AccountsQuerySideServiceTestConfiguration]) - val ctx = sa.run() - - // var server = ctx.getBean(classOf[EmbeddedServletContainer]) - - val port = 8080 - - val baseUrl = s"http://localhost:$port/" - - val restTemplate = ctx.getBean(classOf[RestTemplate]) - - implicit val reallyLongPatienceConfig = PatienceConfig(timeout = Span(10 * 1000, Millis), interval = Span(1 * 1000, Millis)) - - it should "create accounts and transfer money" in { - // FIXME - } -} diff --git a/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceTestConfiguration.scala b/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceTestConfiguration.scala deleted file mode 100644 index c5865c8..0000000 --- a/scala-spring/accounts-query-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/AccountsQuerySideServiceTestConfiguration.scala +++ /dev/null @@ -1,27 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - - -import com.fasterxml.jackson.databind.ObjectMapper -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.context.annotation.{Bean, Configuration, Import} -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter -import org.springframework.web.client.RestTemplate - -import scala.collection.JavaConversions._ - -@Configuration -@Import(Array(classOf[AccountsQuerySideServiceConfiguration])) -class AccountsQuerySideServiceTestConfiguration { - - @Bean - def restTemplate() = { - val restTemplate = new RestTemplate() - restTemplate.getMessageConverters foreach { - case mc: MappingJackson2HttpMessageConverter => - mc.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - case _ => - } - restTemplate - } - -} diff --git a/scala-spring/accounts-query-side-web/build.gradle b/scala-spring/accounts-query-side-web/build.gradle deleted file mode 100644 index 8c99463..0000000 --- a/scala-spring/accounts-query-side-web/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'scala' - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":accounts-query-side-backend") - compile project(":common-web") - - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile scalaTestDependency - -} - - - diff --git a/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/QuerySideWebConfiguration.scala b/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/QuerySideWebConfiguration.scala deleted file mode 100644 index a564d04..0000000 --- a/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/QuerySideWebConfiguration.scala +++ /dev/null @@ -1,13 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.queryside - -import net.chrisrichardson.eventstore.examples.bank.queryside.QuerySideConfiguration -import net.chrisrichardson.eventstore.subscriptions.EnableEventHandlers -import org.springframework.context.annotation._ - -@Configuration -@Import(Array(classOf[QuerySideConfiguration])) -@ComponentScan -@EnableEventHandlers -class QuerySideWebConfiguration { - -} diff --git a/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/controllers/AccountQuerySideController.scala b/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/controllers/AccountQuerySideController.scala deleted file mode 100644 index d0c3e3a..0000000 --- a/scala-spring/accounts-query-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/queryside/controllers/AccountQuerySideController.scala +++ /dev/null @@ -1,18 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.queryside.controllers - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.examples.bank.queryside.{AccountNotFoundException, AccountInfoQueryService} -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.http.HttpStatus -import org.springframework.web.bind.annotation._ - -@RestController -class AccountQuerySideController @Autowired() (accountInfoQueryService : AccountInfoQueryService) { - - @RequestMapping(value=Array("/accounts/{accountId}"), method = Array(RequestMethod.GET)) - def get(@PathVariable accountId : String) = accountInfoQueryService.findByAccountId(EntityId(accountId)) - - @ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "account not found") - @ExceptionHandler(Array(classOf[AccountNotFoundException])) - def accountNotFound() {} -} diff --git a/scala-spring/backend-integration-tests/build.gradle b/scala-spring/backend-integration-tests/build.gradle deleted file mode 100644 index 15c4e5e..0000000 --- a/scala-spring/backend-integration-tests/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -apply plugin: 'scala' -apply plugin: VerifyMongoDBConfigurationPlugin - -dependencies { - - compile "org.scala-lang:scala-library:2.10.2" - - compile project(":transactions-command-side-backend") - compile project(":accounts-command-side-backend") - compile project(":accounts-query-side-backend") - - testCompile scalaTestDependency - - testCompile "junit:junit:4.11" - testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion" -} - - diff --git a/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/MoneyTransferIntegrationTest.scala b/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/MoneyTransferIntegrationTest.scala deleted file mode 100644 index f391d45..0000000 --- a/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/MoneyTransferIntegrationTest.scala +++ /dev/null @@ -1,101 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.accounts.{AccountService, Account} -import net.chrisrichardson.eventstore.examples.bank.backend.common.accounts.AccountDebitedEvent -import net.chrisrichardson.eventstore.examples.bank.config.BankingTestConfiguration -import net.chrisrichardson.eventstore.examples.bank.queryside.AccountInfoQueryService -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.TransferDetails -import net.chrisrichardson.eventstore.examples.bank.transactions.{MoneyTransferService, TransferStates, MoneyTransfer} -import net.chrisrichardson.eventstore.jdbc.config.JdbcEventStoreConfiguration -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.junit.JUnitRunner -import org.scalatest.time.{Millis, Span} -import org.springframework.context.annotation.Import - -import scala.concurrent.{Await, Future} -import scala.concurrent.duration._ -import org.scalatest.concurrent.Eventually._ -import org.scalatest.Matchers._ -import scala.collection.JavaConversions._ -import org.springframework.context.annotation.AnnotationConfigApplicationContext -import scala.reflect.ClassTag - -trait SpringTest { - def configClasses : Seq[Class[_]] - val ctx = new AnnotationConfigApplicationContext(configClasses :_ *) - def bean[T](implicit m : ClassTag[T]) : T = ctx.getBean(m.runtimeClass).asInstanceOf[T] - def bean[T](name : String)(implicit m : ClassTag[T]) : T = ctx.getBean(name, m.runtimeClass).asInstanceOf[T] - -} - - -@RunWith(classOf[JUnitRunner]) -class MoneyTransferIntegrationTest extends FlatSpec with SpringTest { - - def configClasses = Seq(classOf[BankingTestConfiguration]) - - val accountService = bean[AccountService] - val transactionService = bean[MoneyTransferService] - val eventStore = bean[EventStore] - val accountInfoQueryService = bean[AccountInfoQueryService] - - def await[T](body : => Future[T]) = Await.result(body, 500 milliseconds) - - val longWait = PatienceConfig(Span(5000, Millis), Span(50, Millis)) - - - it should "transfer money" in { - val account1 = await { accountService.openAccount(BigDecimal(150)) } - val account2 = await { accountService.openAccount(BigDecimal(300)) } - - val transaction = await { transactionService.transferMoney(TransferDetails(account1.entityId, account2.entityId, BigDecimal(80))) } - - eventually { - val updatedTransaction = await { eventStore.find[MoneyTransfer](transaction.entityId)} - updatedTransaction.entity.state should be(TransferStates.COMPLETED) - }(longWait) - - eventually { - val updatedAccount1 = await { eventStore.find[Account](account1.entityId) } - updatedAccount1.entity.balance should be(70) - }(longWait) - - eventually { - val updatedAccount2 = await { eventStore.find[Account](account2.entityId) } - updatedAccount2.entity.balance should be(380) - }(longWait) - - eventually { - val accountInfo = accountInfoQueryService.findByAccountId(account1.entityId) - accountInfo.balance should be(70*100) - accountInfo.changes.map(_.transactionType) should be(Seq(classOf[AccountDebitedEvent].getSimpleName)) - }(longWait) - - } - - it should "fail to transfer money due to insufficient funds" in { - val account1 = await { accountService.openAccount(BigDecimal(150)) } - val account2 = await { accountService.openAccount(BigDecimal(300)) } - - val transaction = await { transactionService.transferMoney(TransferDetails(account1.entityId, account2.entityId, BigDecimal(200))) } - - eventually { - val updatedTransaction = await { eventStore.find[MoneyTransfer](transaction.entityId)} - updatedTransaction.entity.state should be(TransferStates.FAILED_DUE_TO_INSUFFICIENT_FUNDS) - }(longWait) - - eventually { - val updatedAccount1 = await { eventStore.find[Account](account1.entityId) } - updatedAccount1.entity.balance should be(150) - }(longWait) - - eventually { - val updatedAccount2 = await { eventStore.find[Account](account2.entityId) } - updatedAccount2.entity.balance should be(300) - }(longWait) - - } - -} diff --git a/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/config/BankingTestConfiguration.scala b/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/config/BankingTestConfiguration.scala deleted file mode 100644 index bda4368..0000000 --- a/scala-spring/backend-integration-tests/src/test/scala/net/chrisrichardson/eventstore/examples/bank/config/BankingTestConfiguration.scala +++ /dev/null @@ -1,15 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.config - -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountConfiguration -import net.chrisrichardson.eventstore.examples.bank.queryside.QuerySideConfiguration -import net.chrisrichardson.eventstore.examples.bank.transactions.TransactionConfiguration -import net.chrisrichardson.eventstore.jdbc.config.JdbcEventStoreConfiguration -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.context.annotation.{Import, Configuration} - -@Configuration -@EnableAutoConfiguration -@Import(Array(classOf[JdbcEventStoreConfiguration], classOf[AccountConfiguration], classOf[TransactionConfiguration], classOf[QuerySideConfiguration])) -class BankingTestConfiguration { - -} diff --git a/scala-spring/build-and-test-all.sh b/scala-spring/build-and-test-all.sh deleted file mode 100755 index 5ea0a3b..0000000 --- a/scala-spring/build-and-test-all.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -../_build-and-test-all.sh $* diff --git a/scala-spring/build.gradle b/scala-spring/build.gradle deleted file mode 100644 index d522a5a..0000000 --- a/scala-spring/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion") - } -} - -allprojects { - group = "net.chrisrichardson.eventstore" -} - - -task wrapper(type: Wrapper) { - gradleVersion = '2.0' -} - -subprojects { - apply plugin: 'java' - apply plugin: 'scala' - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - - repositories { - mavenCentral() - eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } } - } -} diff --git a/scala-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy b/scala-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy deleted file mode 100644 index 030e0e1..0000000 --- a/scala-spring/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy +++ /dev/null @@ -1,15 +0,0 @@ -import org.gradle.api.* - - -class VerifyEventStoreEnvironmentPlugin implements Plugin { - void apply(Project project) { - project.test { - beforeSuite { x -> - if (x.parent == null) { - if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null) - logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n") - } - } - } - } -} diff --git a/scala-spring/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy b/scala-spring/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy deleted file mode 100644 index 1486a0d..0000000 --- a/scala-spring/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy +++ /dev/null @@ -1,15 +0,0 @@ -import org.gradle.api.* - - -class VerifyMongoDBConfigurationPlugin implements Plugin { - void apply(Project project) { - project.test { - beforeSuite { x -> - if (x.parent == null) { - if (System.getenv("SPRING_DATA_MONGODB_URI") == null) - throw new RuntimeException("Please make sure that the environment variable SPRING_DATA_MONGODB_URI is set, e.g. export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb") - } - } - } - } -} \ No newline at end of file diff --git a/scala-spring/common-backend/build.gradle b/scala-spring/common-backend/build.gradle deleted file mode 100644 index 44619f0..0000000 --- a/scala-spring/common-backend/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'scala' - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - - testCompile scalaTestDependency - - testCompile "junit:junit:4.11" -} diff --git a/scala-spring/common-backend/src/main/resources/logback.xml b/scala-spring/common-backend/src/main/resources/logback.xml deleted file mode 100644 index d4123dc..0000000 --- a/scala-spring/common-backend/src/main/resources/logback.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - diff --git a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/AccountEvents.scala b/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/AccountEvents.scala deleted file mode 100644 index 76a479f..0000000 --- a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/AccountEvents.scala +++ /dev/null @@ -1,18 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.backend.common.accounts - -import net.chrisrichardson.eventstore.{EntityId, Event} - -trait AccountChangedEvent extends Event { - val amount : BigDecimal - val transactionId : EntityId -} - -case class AccountOpenedEvent(initialBalance : BigDecimal) extends Event - -case class AccountCreditedEvent(amount : BigDecimal, transactionId : EntityId) extends AccountChangedEvent - -case class AccountDebitedEvent(amount : BigDecimal, transactionId : EntityId) extends AccountChangedEvent - -case class AccountDebitFailedDueToInsufficientFundsEvent(amount : BigDecimal, transactionId : EntityId) extends AccountChangedEvent - - diff --git a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/package-info.java b/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/package-info.java deleted file mode 100644 index 6663c42..0000000 --- a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/accounts/package-info.java +++ /dev/null @@ -1,2 +0,0 @@ -@net.chrisrichardson.eventstore.EventEntity(entity="net.chrisrichardson.eventstore.examples.bank.accounts.Account") -package net.chrisrichardson.eventstore.examples.bank.backend.common.accounts; \ No newline at end of file diff --git a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransactionEvents.scala b/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransactionEvents.scala deleted file mode 100644 index be3ed86..0000000 --- a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransactionEvents.scala +++ /dev/null @@ -1,8 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.backend.common.transactions - -import net.chrisrichardson.eventstore.Event - -case class MoneyTransferCreatedEvent(details : TransferDetails) extends Event -case class DebitRecordedEvent(details : TransferDetails) extends Event -case class CreditRecordedEvent(details : TransferDetails) extends Event -case class TransferFailedDueToInsufficientFundsEvent() extends Event diff --git a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransferDetails.scala b/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransferDetails.scala deleted file mode 100644 index 5546a38..0000000 --- a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/TransferDetails.scala +++ /dev/null @@ -1,6 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.backend.common.transactions - -import net.chrisrichardson.eventstore.EntityId - - -case class TransferDetails(fromAccountId : EntityId, toAccountId : EntityId, amount : BigDecimal) diff --git a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/package-info.java b/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/package-info.java deleted file mode 100644 index f243e0e..0000000 --- a/scala-spring/common-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/backend/common/transactions/package-info.java +++ /dev/null @@ -1,2 +0,0 @@ -@net.chrisrichardson.eventstore.EventEntity(entity="net.chrisrichardson.eventstore.examples.bank.transactions.MoneyTransfer") -package net.chrisrichardson.eventstore.examples.bank.backend.common.transactions; \ No newline at end of file diff --git a/scala-spring/common-web/build.gradle b/scala-spring/common-web/build.gradle deleted file mode 100644 index 6973ba4..0000000 --- a/scala-spring/common-web/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'scala' - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - -} - - - diff --git a/scala-spring/common-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/util/WebUtil.scala b/scala-spring/common-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/util/WebUtil.scala deleted file mode 100644 index c63e376..0000000 --- a/scala-spring/common-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/util/WebUtil.scala +++ /dev/null @@ -1,20 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.util - -import org.springframework.web.context.request.async.DeferredResult - -import scala.concurrent.ExecutionContext.Implicits.global -import scala.concurrent.Future - -object WebUtil { - def toDeferredResult[T](future: Future[T]): DeferredResult[T] = { - val result = new DeferredResult[T] - future onSuccess { - case r => result.setResult(r) - } - future onFailure { - case t => result.setErrorResult(t) - } - result - } - -} diff --git a/scala-spring/docker-compose.yml b/scala-spring/docker-compose.yml deleted file mode 100644 index c19a110..0000000 --- a/scala-spring/docker-compose.yml +++ /dev/null @@ -1,46 +0,0 @@ -accountscommandside: - image: java:8 - working_dir: /app - volumes: - - ./accounts-command-side-service/build/libs:/app - command: java -jar /app/accounts-command-side-service.jar - ports: - - "8080:8080" - environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - -transactionscommandside: - image: java:8 - working_dir: /app - volumes: - - ./transactions-command-side-service/build/libs:/app - command: java -jar /app/transactions-command-side-service.jar - ports: - - "8082:8080" - environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - - -accountsqueryside: - image: java:8 - working_dir: /app - volumes: - - ./accounts-query-side-service/build/libs:/app - command: java -jar /app/accounts-query-side-service.jar - ports: - - "8081:8080" - links: - - mongodb - environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb - -mongodb: - image: mongo:3.0.4 - hostname: mongodb - command: mongod --smallfiles - ports: - - "27017:27017" diff --git a/scala-spring/e2e-test/build.gradle b/scala-spring/e2e-test/build.gradle deleted file mode 100644 index 8a9dd60..0000000 --- a/scala-spring/e2e-test/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -apply plugin: 'scala' -apply plugin: VerifyMongoDBConfigurationPlugin - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - - testCompile project(":accounts-command-side-web") - testCompile project(":transactions-command-side-web") - testCompile project(":accounts-query-side-web") - - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile scalaTestDependency - -} - -test { - ignoreFailures (!project.hasProperty("ignoreE2EFailures") || ignoreE2EFailures.toBoolean()) -} diff --git a/scala-spring/e2e-test/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.scala b/scala-spring/e2e-test/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.scala deleted file mode 100644 index fd3ae03..0000000 --- a/scala-spring/e2e-test/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/EndToEndTest.scala +++ /dev/null @@ -1,68 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.examples.bank.queryside.AccountInfo -import net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers.{CreateAccountRequest, CreateAccountResponse} -import net.chrisrichardson.eventstore.examples.bank.web.transactions.controllers.{CreateMoneyTransferResponse, GetMoneyTransferResponse, MoneyTransferRequest} -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping.EventStoreCommonObjectMapper -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers._ -import org.scalatest.concurrent.Eventually._ -import org.scalatest.junit.JUnitRunner -import org.scalatest.time.{Millis, Span} -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter -import org.springframework.web.client.RestTemplate -import scala.collection.JavaConversions._ - -@RunWith(classOf[JUnitRunner]) -class EndToEndTest extends FlatSpec { - - val serviceHost = Option(System.getenv("SERVICE_HOST")) getOrElse "localhost" - val accountsCommandSideBaseUrl = s"http://$serviceHost:8080/" - val accountsQuerySideBaseUrl = s"http://$serviceHost:8081/" - val transactionsCommandSideBaseUrl = s"http://$serviceHost:8082/" - - val restTemplate = new RestTemplate() - restTemplate.getMessageConverters foreach { - case mc: MappingJackson2HttpMessageConverter => - mc.setObjectMapper(EventStoreCommonObjectMapper) - case _ => - } - - implicit val reallyLongPatienceConfig = PatienceConfig(timeout = Span(10 * 1000, Millis), interval = Span(1 * 1000, Millis)) - - it should "create accounts and transfer money" in { - - val CreateAccountResponse(fromAccountId) = restTemplate.postForEntity(s"$accountsCommandSideBaseUrl/accounts", CreateAccountRequest(BigDecimal(500)), classOf[CreateAccountResponse]).getBody - val CreateAccountResponse(toAccountId) = restTemplate.postForEntity(s"$accountsCommandSideBaseUrl/accounts", CreateAccountRequest(BigDecimal(100)), classOf[CreateAccountResponse]).getBody - - eventually { - val accountInfo = restTemplate.getForEntity(s"$accountsQuerySideBaseUrl/accounts/" + fromAccountId, classOf[AccountInfo]).getBody - accountInfo should not be null - val AccountInfo(accountId, initialBalance, _, _, _) = accountInfo - accountId should be(fromAccountId) - initialBalance should be(500*100) - }(reallyLongPatienceConfig) - - - val CreateMoneyTransferResponse(transactionId) = restTemplate.postForEntity(s"$transactionsCommandSideBaseUrl/transfers", - MoneyTransferRequest(EntityId(fromAccountId), EntityId(toAccountId), BigDecimal(150)), classOf[CreateMoneyTransferResponse]).getBody - - eventually { - val AccountInfo(_, newFromAccountBalance, _, _, _) = restTemplate.getForEntity(s"$accountsQuerySideBaseUrl/accounts/" + fromAccountId, classOf[AccountInfo]).getBody - newFromAccountBalance should be(350*100) - }(reallyLongPatienceConfig) - eventually { - val AccountInfo(_, newToAccountBalance, _, _, _) = restTemplate.getForEntity(s"$accountsQuerySideBaseUrl/accounts/" + toAccountId, classOf[AccountInfo]).getBody - newToAccountBalance should be(250*100) - }(reallyLongPatienceConfig) - - eventually { - val GetMoneyTransferResponse(_, state) = restTemplate.getForEntity(s"$transactionsCommandSideBaseUrl/transfers/" + transactionId, classOf[GetMoneyTransferResponse]).getBody - state should be("COMPLETED$") - }(reallyLongPatienceConfig) - - } - -} diff --git a/scala-spring/gradle.properties b/scala-spring/gradle.properties deleted file mode 100644 index 6ec43fa..0000000 --- a/scala-spring/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ - -org.gradle.jvmargs=-XX:MaxPermSize=512m - -eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release - -scalaTestDependency=org.scalatest:scalatest_2.10:2.0 - -springBootVersion=1.2.8.RELEASE - -eventStoreClientVersion=0.12 diff --git a/scala-spring/gradle/gradle/wrapper/gradle-wrapper.jar b/scala-spring/gradle/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index b7612167031001b7b84baf2a959e8ea8ad03c011..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51017 zcmaI7W0WY(vMt)SZQHhOcduS;+qP}nwr$(CZEH2&I&bfL-u=$q_vNUpQ9mL_Wky9t z&WM<$APo!x1poj60q`KZF9Ptl0sYtQZ-e~XWkpp4X(i>v=z#$g{vp^9t%kz;S3u=&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apqV-wjygg=(~XMw1!wA+ZmvtdJd@ zcVXDL!;jt*hM$xSWb|V5;N_5f_WUa%=fLiHZc=RwAP?g{1k$#IJ@rpQDzM0S==wqV zuQs2k@FdSjX9xiXc>%x&AMp91!w2jezS%A5 z{J&%pJdz@U0D{d>Y6F%W(OF!a{d&jI}FEa3CvNAhp4S}!cX0_+zN zM5tbbqX9~92`Kr0n&1a$t=Gf<0DQWv11#_yop|hQ4FUSIMmj&mm7g;19x2%r16Y;; zAEF;@-(Iy|_JBP6p$H;>mErp?^C=!^k@Kn=pajx@)YN~&dj~KU{{ioNU~+kY1iY|? znVz_Xg^8WzpP_L!)tCDKAh&>C`t3ycucy`v0`ia00Nq_vI~%|)GC?C#Jsuq$JsTSd zEpsh{zoH#H&AU#8SMxhS-Vp!>y}#!j_xT?Q6u-yD0N6V8jSTDn64n4Y_dn-d+6~ue z8&D;ffV|WFm2tqk)@u-;E%1kGdD@=BfPf9A|1IO@hXg%X0N)TRKsLYKTl(v%_4`q>gm}1pXm5g)bQ@uPecGzKL9GlUy%PPK0d%O^9R)L{rCs=w@m-JBAy0N{R_I* zD@gEiR!<|wLgV_sx^ z=C zzWm)Q_GzY{IvxHb_?-MN2!0)<{#=5mE?++h=F)y6_-mH0@h4Sa;XhIRkGb^eDceujy`q1D{V`zt z!w`yT~*Y9Ibd^H}j4%`dP&3iSQ;4`bg`L*Y++h3bES t|KH7qPwVTc?c*oWQQiM74F8)Y \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/scala-spring/gradle/gradlew.bat b/scala-spring/gradle/gradlew.bat deleted file mode 100644 index aec9973..0000000 --- a/scala-spring/gradle/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/scala-spring/gradle/wrapper/gradle-wrapper.jar b/scala-spring/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 667288ad6c2b3b87c990ece1267e56f0bcbf3622..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50514 zcmagFbChSz(k5EAZQHhOS9NvSwr&2(Rb94i+qSxF+w8*h%sKPjdA~XL-o1A2m48I8 z#Ey)JC!a_qSx_(-ARs6xAQ?F>QJ}vM$p8HOeW3pqd2uyidT9j-Mo=K7e+XW0&Y<)E z6;S(I(Ed+Bd0_=<32{|526>4G`Kd`cS$c+fcv*UynW@=E6{aQD-J|;{`Z4Kg`Dt2d zI$)UdFq4$SA}#7RO!AV$BBL=9%jVsq{Ueb7*4^J8{%c%df9v*6=Kt4_{!ba$f6JIV z8JgIb{(p+1{!`T5$U)an0fVi9CwR`^$R`EMcp&rQVa-R*4b4Nb_H8H{ZVot=H7 z#(J{{DW4ze_Ck|1(EbPiGfXTO}v^zl-H!Y3ls9=HV&q>SAGP=VEDW z=wk2muSF2y_lb}fJxZ}al~$+3RF^U!k9x5x zWyl(8dbQ0`AG$%Y?*M0m+cp^Qa}1udZW_Tm3>qdzZv!1x+<_Uf(p@M@ymKp>OX9|F z#L1je z9d6SUXxx2fS*7N*e<;=+3&t4*d+M`}GIPJUbTo-OSVjvF3WrfXg7*_H3ct9cxJKZ9 zLrMzth3?nx0{#c^OdHM`vr>x#A)-roI0OOn<=2h_wo|XV0&wMtLI5!@**l*_XQ2R` zrLSV49cUPRsX#(O5oQzZaIYwwq8Zs2DLXGdDKbr!Yg?7fxU|>+HHQ`48#X--yYCk5 z2_CBTW9rX2eLQC0%EyQli<87+%+Sy))FFW+RMC{*hfJ$|;#$?pAT~P0nL-F}%M*RxwBh)JT4trq7rR7dHloLmiM^IC{>usB=4fXXH9NMyWznFd(bffDK zE@*_maXO?|$?M^W>jXtsnk2}7g8b8%oLp);SNzqtjlYHDKkJ?J|K42x(kk(o{=Zub zF6?{i>=+HX3r6qB=&q|022@z-QLmMSLx%Up}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lxlA6^65mdV|9*13bwQ@&Kj48xXU!e# zK=-Z0faZpR`uc`;cCr9VfbriU3BU>T%e|X)K~;nTB4PX+9rT^!T?eB41A&??z#4RI z4`i({0vbDj^qWCK=6}w+f;%B_15|2UP&Z)t1sd@9kI>+iE&+n8$d3#01@Mvj>=){~2wuLnf#P zRQ@2G=6EwR z{}K9otBE=p>O1^LaT^>JMf%m3JrF8AC^`rzhyQtUycwI0)u0Miy8gE)NuSK% zm&FgF>CE4VetTX2sk?!nT>n6x2W?pXWgY$b92>k4;0K03s7CYtiRypMrQnBPKVTIL z{t5Q`fbkDUV&DY;H+2uJK5$#! z5B!#je}VtsEqmbg1#Y1DK_p-EpM~LnGgrt \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/scala-spring/gradlew.bat b/scala-spring/gradlew.bat deleted file mode 100644 index aec9973..0000000 --- a/scala-spring/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/scala-spring/handy-curl-commands.sh b/scala-spring/handy-curl-commands.sh deleted file mode 100644 index f7424c7..0000000 --- a/scala-spring/handy-curl-commands.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/bash -e - - -# Create account 1 - -account1=$(curl -v --data '{"initialBalance" : 500}' -H "content-type: application/json" http://localhost:8080/accounts) - -# {"accountId":"0000014ae4caf314-ae7453bbb71e0000"} - -curl -v http://localhost:8081/accounts/0000014ae4caf314-ae7453bbb71e0000 - -# {"accountId":"0000014ae4caf314-ae7453bbb71e0000","balance":50000} - -# Create account 2 - -account2=$(curl -v --data '{"initialBalance" : 300}' -H "content-type: application/json" http://localhost:8080/accounts) - -# {"accountId":"0000014ae4cc8415-ae7453bbb71e0000"} - -curl -v http://localhost:8081/accounts/0000014ae4cc8415-ae7453bbb71e0000 - -# - - -transfer=$(curl -v --data '{"amount" : 150, "fromAccountId" : "0000014ae4caf314-ae7453bbb71e0000", "toAccountId" : "0000014ae4cc8415-ae7453bbb71e0000"}' -H "content-type: application/json" http://localhost:8082/transfers) - -# {"moneyTransferId":"0000014ae4cef030-ae7453bbb71e0000"} - - - - - - - - - diff --git a/scala-spring/monolithic-service/build.gradle b/scala-spring/monolithic-service/build.gradle deleted file mode 100644 index 054ba23..0000000 --- a/scala-spring/monolithic-service/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -apply plugin: 'scala' -apply plugin: 'spring-boot' -apply plugin: VerifyMongoDBConfigurationPlugin - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":accounts-command-side-web") - compile project(":transactions-command-side-web") - compile project(":accounts-query-side-web") - - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" - - compile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion" - - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile scalaTestDependency - -} - - - diff --git a/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppConfiguration.scala b/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppConfiguration.scala deleted file mode 100644 index 2643e1d..0000000 --- a/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppConfiguration.scala +++ /dev/null @@ -1,31 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.embedded.config.EmbeddedEventStoreConfiguration -import net.chrisrichardson.eventstore.examples.bank.accounts.AccountConfiguration -import net.chrisrichardson.eventstore.examples.bank.queryside.QuerySideConfiguration -import net.chrisrichardson.eventstore.examples.bank.transactions.TransactionConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.accounts.CommandSideWebAccountsConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.queryside.QuerySideWebConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.transactions.CommandSideWebTransactionsConfiguration -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.web.HttpMessageConverters -import org.springframework.context.annotation._ -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter - -@Configuration -@EnableAutoConfiguration -@Import(Array(classOf[CommandSideWebTransactionsConfiguration], classOf[CommandSideWebAccountsConfiguration], classOf[QuerySideWebConfiguration], - classOf[EmbeddedEventStoreConfiguration])) -@ComponentScan -class BankingWebAppConfiguration { - - - @Bean - def scalaJSonConverter: HttpMessageConverters = { - val additional = new MappingJackson2HttpMessageConverter - additional.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - new HttpMessageConverters(additional) - } - -} diff --git a/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/BankingMain.scala b/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/BankingMain.scala deleted file mode 100644 index ca4ac28..0000000 --- a/scala-spring/monolithic-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/BankingMain.scala +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.main - -import net.chrisrichardson.eventstore.examples.bank.web.BankingWebAppConfiguration -import org.springframework.boot.SpringApplication - -object BankingMain { - - def main(args: Array[String]) : Unit = SpringApplication.run(classOf[BankingWebAppConfiguration], args :_ *) - -} diff --git a/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankWebIntegrationTest.scala b/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankWebIntegrationTest.scala deleted file mode 100644 index 72d9087..0000000 --- a/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankWebIntegrationTest.scala +++ /dev/null @@ -1,70 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.examples.bank.queryside.AccountInfo -import net.chrisrichardson.eventstore.examples.bank.web.accounts.controllers.{CreateAccountRequest, CreateAccountResponse} -import net.chrisrichardson.eventstore.examples.bank.web.transactions.controllers.{CreateMoneyTransferResponse, GetMoneyTransferResponse, MoneyTransferRequest} -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.Matchers._ -import org.scalatest.concurrent.Eventually._ -import org.scalatest.junit.JUnitRunner -import org.scalatest.time.{Millis, Span} -import org.springframework.boot.SpringApplication -import org.springframework.http.HttpStatus -import org.springframework.web.client.{HttpClientErrorException, RestTemplate} - -@RunWith(classOf[JUnitRunner]) -class BankWebIntegrationTest extends FlatSpec { - - val sa = new SpringApplication(classOf[BankingWebAppTestConfiguration]) - val ctx = sa.run() - - // var server = ctx.getBean(classOf[EmbeddedServletContainer]) - - val port = 8080 - - val baseUrl = s"http://localhost:$port/" - - val restTemplate = ctx.getBean(classOf[RestTemplate]) - - implicit val reallyLongPatienceConfig = PatienceConfig(timeout = Span(10 * 1000, Millis), interval = Span(1 * 1000, Millis)) - - it should "create accounts and transfer money" in { - - val CreateAccountResponse(fromAccountId) = restTemplate.postForEntity(s"$baseUrl/accounts", CreateAccountRequest(BigDecimal(500)), classOf[CreateAccountResponse]).getBody - val CreateAccountResponse(toAccountId) = restTemplate.postForEntity(s"$baseUrl/accounts", CreateAccountRequest(BigDecimal(100)), classOf[CreateAccountResponse]).getBody - - val AccountInfo(accountId, initialBalance, _, _, _) = eventually { - val accountInfo = restTemplate.getForEntity(s"$baseUrl/accounts/" + fromAccountId, classOf[AccountInfo]).getBody - accountInfo should not be null - accountInfo - }(reallyLongPatienceConfig) - - accountId should be(fromAccountId) - initialBalance should be(500*100) - - val CreateMoneyTransferResponse(transactionId) = restTemplate.postForEntity(s"$baseUrl/transfers", - MoneyTransferRequest(EntityId(fromAccountId), EntityId(toAccountId), BigDecimal(150)), classOf[CreateMoneyTransferResponse]).getBody - - eventually { - val AccountInfo(_, newFromAccountBalance, _, _, _) = restTemplate.getForEntity(s"$baseUrl/accounts/" + fromAccountId, classOf[AccountInfo]).getBody - newFromAccountBalance should be(350*100) - }(reallyLongPatienceConfig) - eventually { - val AccountInfo(_, newToAccountBalance, _, _, _) = restTemplate.getForEntity(s"$baseUrl/accounts/" + toAccountId, classOf[AccountInfo]).getBody - newToAccountBalance should be(250*100) - }(reallyLongPatienceConfig) - - eventually { - val GetMoneyTransferResponse(_, state) = restTemplate.getForEntity(s"$baseUrl/transfers/" + transactionId, classOf[GetMoneyTransferResponse]).getBody - state should be("COMPLETED$") - }(reallyLongPatienceConfig) - - } - - it should "Return 404 for non-existent account" in { - val t = the[HttpClientErrorException] thrownBy restTemplate.getForEntity(s"$baseUrl/accounts/" + "non-existent-account-id", classOf[AccountInfo]) - t.getStatusCode shouldBe HttpStatus.NOT_FOUND - } -} diff --git a/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppTestConfiguration.scala b/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppTestConfiguration.scala deleted file mode 100644 index f4c6a24..0000000 --- a/scala-spring/monolithic-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/BankingWebAppTestConfiguration.scala +++ /dev/null @@ -1,27 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - - -import com.fasterxml.jackson.databind.ObjectMapper -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.context.annotation.{Bean, Import, Configuration} -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter -import org.springframework.web.client.RestTemplate -import scala.collection.JavaConversions._ - -@Configuration -@Import(Array(classOf[BankingWebAppConfiguration])) -class BankingWebAppTestConfiguration { - - @Bean - def restTemplate() = { - val restTemplate = new RestTemplate() - restTemplate.getMessageConverters foreach { - case mc: MappingJackson2HttpMessageConverter => - mc.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - case _ => - } - restTemplate - } - -} diff --git a/scala-spring/settings.gradle b/scala-spring/settings.gradle deleted file mode 100644 index 3beee8e..0000000 --- a/scala-spring/settings.gradle +++ /dev/null @@ -1,23 +0,0 @@ -include 'common-web' - -include 'common-backend' - -include 'accounts-command-side-backend' -include 'transactions-command-side-backend' -include 'accounts-command-side-web' -include 'transactions-command-side-web' - - -include 'accounts-query-side-backend' -include 'accounts-query-side-web' - -include 'backend-integration-tests' - -include 'monolithic-service' -include 'accounts-command-side-service' -include 'accounts-query-side-service' -include 'transactions-command-side-service' - -include 'e2e-test' - -rootProject.name = 'scala-spring-event-sourcing-example' diff --git a/scala-spring/transactions-command-side-backend/build.gradle b/scala-spring/transactions-command-side-backend/build.gradle deleted file mode 100644 index 222d391..0000000 --- a/scala-spring/transactions-command-side-backend/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":common-backend") - compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion" -} diff --git a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransfer.scala b/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransfer.scala deleted file mode 100644 index 479a56b..0000000 --- a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransfer.scala +++ /dev/null @@ -1,46 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.transactions - -import net.chrisrichardson.eventstore.PatternMatchingCommandProcessingAggregate -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions._ -import net.chrisrichardson.eventstore.examples.bank.transactions.MoneyTransferCommands._ - -object TransferStates { - sealed trait State - object NEW extends State - object INITIAL extends State - object DEBITED extends State - object COMPLETED extends State - object FAILED_DUE_TO_INSUFFICIENT_FUNDS extends State -} - - - -case class MoneyTransfer(state : TransferStates.State, details : TransferDetails) - extends PatternMatchingCommandProcessingAggregate[MoneyTransfer, MoneyTransferCommand] { - - def this() = this(TransferStates.NEW, null) - - def processCommand = { - case CreateMoneyTransferCommand(withDetails) if state == TransferStates.NEW => - Seq(MoneyTransferCreatedEvent(withDetails)) - - case RecordDebitCommand(accountId) if state == TransferStates.INITIAL && accountId == details.fromAccountId => - Seq(DebitRecordedEvent(details)) - - case RecordDebitFailedDueToInsufficientFundsCommand(accountId) if state == TransferStates.INITIAL && accountId == details.fromAccountId => - Seq(TransferFailedDueToInsufficientFundsEvent()) - - case RecordCreditCommand(accountId) if state == TransferStates.DEBITED && accountId == details.toAccountId => - Seq(CreditRecordedEvent(details)) - } - - def applyEvent = { - - case MoneyTransferCreatedEvent(withDetails) => copy(state=TransferStates.INITIAL, details=withDetails) - case DebitRecordedEvent(_) => copy(state=TransferStates.DEBITED) - case TransferFailedDueToInsufficientFundsEvent() => copy(state=TransferStates.FAILED_DUE_TO_INSUFFICIENT_FUNDS) - case CreditRecordedEvent(_) => copy(state=TransferStates.COMPLETED) - - } - -} diff --git a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferCommands.scala b/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferCommands.scala deleted file mode 100644 index 1c2992a..0000000 --- a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferCommands.scala +++ /dev/null @@ -1,15 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.transactions - -import net.chrisrichardson.eventstore.{Command, EntityId} -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.TransferDetails - -object MoneyTransferCommands { - - sealed trait MoneyTransferCommand extends Command - - case class CreateMoneyTransferCommand(details : TransferDetails) extends MoneyTransferCommand - case class RecordDebitCommand(accountId : EntityId) extends MoneyTransferCommand - case class RecordDebitFailedDueToInsufficientFundsCommand(accountId : EntityId) extends MoneyTransferCommand - case class RecordCreditCommand(accountId : EntityId) extends MoneyTransferCommand - -} diff --git a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferEventHandlers.scala b/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferEventHandlers.scala deleted file mode 100644 index 92a43f3..0000000 --- a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferEventHandlers.scala +++ /dev/null @@ -1,34 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.transactions - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.backend.common.accounts._ -import net.chrisrichardson.eventstore.examples.bank.transactions.MoneyTransferCommands.{RecordDebitFailedDueToInsufficientFundsCommand, RecordCreditCommand, RecordDebitCommand} -import net.chrisrichardson.eventstore.subscriptions.{CompoundEventHandler, EventSubscriber} -import net.chrisrichardson.eventstore.util.EventHandlingUtil._ -import net.chrisrichardson.eventstore.subscriptions.EventHandler - -@EventSubscriber (id = "transactionEventHandlers") -class MoneyTransferEventHandlers(implicit eventStore: EventStore) - extends CompoundEventHandler { - - @EventHandler - val recordDebit = - handlerForEvent[AccountDebitedEvent] { de => - existingEntity[MoneyTransfer](de.event.transactionId) <== - RecordDebitCommand(de.entityId) - } - - @EventHandler - val recordCredit = - handlerForEvent[AccountCreditedEvent] { de => - existingEntity[MoneyTransfer](de.event.transactionId) <== - RecordCreditCommand(de.entityId) - } - - @EventHandler - val recordDebitFailed = - handlerForEvent[AccountDebitFailedDueToInsufficientFundsEvent] { de => - existingEntity[MoneyTransfer](de.event.transactionId) <== - RecordDebitFailedDueToInsufficientFundsCommand(de.entityId) - } -} diff --git a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferService.scala b/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferService.scala deleted file mode 100644 index 2652472..0000000 --- a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/MoneyTransferService.scala +++ /dev/null @@ -1,13 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.transactions - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.TransferDetails -import net.chrisrichardson.eventstore.examples.bank.transactions.MoneyTransferCommands.CreateMoneyTransferCommand -import net.chrisrichardson.eventstore.util.ServiceUtil._ - -class MoneyTransferService(implicit eventStore : EventStore) { - - def transferMoney(transferDetails : TransferDetails) = - newEntity[MoneyTransfer] <== CreateMoneyTransferCommand(transferDetails) - -} diff --git a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/TransactionConfiguration.scala b/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/TransactionConfiguration.scala deleted file mode 100644 index 73fff8d..0000000 --- a/scala-spring/transactions-command-side-backend/src/main/scala/net/chrisrichardson/eventstore/examples/bank/transactions/TransactionConfiguration.scala +++ /dev/null @@ -1,18 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.transactions - -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.subscriptions.EnableEventHandlers -import org.springframework.context.annotation.{Bean, Configuration} - -@Configuration -@EnableEventHandlers -class TransactionConfiguration { - - @Bean - def accountTransactionService(eventStore : EventStore) = new MoneyTransferService()(eventStore) - - @Bean - def moneyTransferWorkflow(eventStore: EventStore): MoneyTransferEventHandlers = { - new MoneyTransferEventHandlers()(eventStore) - } -} diff --git a/scala-spring/transactions-command-side-service/build.gradle b/scala-spring/transactions-command-side-service/build.gradle deleted file mode 100644 index 033dc31..0000000 --- a/scala-spring/transactions-command-side-service/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -apply plugin: 'scala' -apply plugin: 'spring-boot' -apply plugin: VerifyEventStoreEnvironmentPlugin - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":transactions-command-side-web") - - compile "org.springframework.boot:spring-boot-starter-web" - compile "org.springframework.boot:spring-boot-starter-actuator" - - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" - - testCompile "org.springframework.boot:spring-boot-starter-test" - testCompile scalaTestDependency - -} - -test { - ignoreFailures true -} - diff --git a/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceConfiguration.scala b/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceConfiguration.scala deleted file mode 100644 index b3ae274..0000000 --- a/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceConfiguration.scala +++ /dev/null @@ -1,24 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration -import net.chrisrichardson.eventstore.examples.bank.web.transactions.CommandSideWebTransactionsConfiguration -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.web.HttpMessageConverters -import org.springframework.context.annotation._ -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter - -@Configuration -@EnableAutoConfiguration -@Import(Array(classOf[CommandSideWebTransactionsConfiguration], classOf[EventStoreHttpClientConfiguration])) -@ComponentScan -class TransactionsCommandSideServiceConfiguration { - - @Bean - def scalaJSonConverter: HttpMessageConverters = { - val additional = new MappingJackson2HttpMessageConverter - additional.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - new HttpMessageConverters(additional) - } - -} diff --git a/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/TransactionsCommandSideServiceMain.scala b/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/TransactionsCommandSideServiceMain.scala deleted file mode 100644 index f9a3728..0000000 --- a/scala-spring/transactions-command-side-service/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/main/TransactionsCommandSideServiceMain.scala +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.main - -import net.chrisrichardson.eventstore.examples.bank.web.TransactionsCommandSideServiceConfiguration -import org.springframework.boot.SpringApplication - -object TransactionsCommandSideServiceMain { - - def main(args: Array[String]) : Unit = SpringApplication.run(classOf[TransactionsCommandSideServiceConfiguration], args :_ *) - -} diff --git a/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceIntegrationTest.scala b/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceIntegrationTest.scala deleted file mode 100644 index 8465635..0000000 --- a/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceIntegrationTest.scala +++ /dev/null @@ -1,30 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - -import org.junit.runner.RunWith -import org.scalatest.FlatSpec -import org.scalatest.concurrent.Eventually._ -import org.scalatest.junit.JUnitRunner -import org.scalatest.time.{Millis, Span} -import org.springframework.boot.SpringApplication -import org.springframework.web.client.RestTemplate - -@RunWith(classOf[JUnitRunner]) -class TransactionsCommandSideServiceIntegrationTest extends FlatSpec { - - val sa = new SpringApplication(classOf[TransactionsCommandSideServiceTestConfiguration]) - val ctx = sa.run() - - // var server = ctx.getBean(classOf[EmbeddedServletContainer]) - - val port = 8080 - - val baseUrl = s"http://localhost:$port/" - - val restTemplate = ctx.getBean(classOf[RestTemplate]) - - implicit val reallyLongPatienceConfig = PatienceConfig(timeout = Span(10 * 1000, Millis), interval = Span(1 * 1000, Millis)) - - it should "create accounts and transfer money" in { - // FIXME - } -} diff --git a/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceTestConfiguration.scala b/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceTestConfiguration.scala deleted file mode 100644 index 3cf4b2b..0000000 --- a/scala-spring/transactions-command-side-service/src/test/scala/net/chrisrichardson/eventstore/examples/bank/web/TransactionsCommandSideServiceTestConfiguration.scala +++ /dev/null @@ -1,27 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web - - -import com.fasterxml.jackson.databind.ObjectMapper -import net.chrisrichardson.eventstore.json.EventStoreCommonObjectMapping -import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.context.annotation.{Bean, Import, Configuration} -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter -import org.springframework.web.client.RestTemplate -import scala.collection.JavaConversions._ - -@Configuration -@Import(Array(classOf[TransactionsCommandSideServiceConfiguration])) -class TransactionsCommandSideServiceTestConfiguration { - - @Bean - def restTemplate() = { - val restTemplate = new RestTemplate() - restTemplate.getMessageConverters foreach { - case mc: MappingJackson2HttpMessageConverter => - mc.setObjectMapper(EventStoreCommonObjectMapping.getObjectMapper) - case _ => - } - restTemplate - } - -} diff --git a/scala-spring/transactions-command-side-web/build.gradle b/scala-spring/transactions-command-side-web/build.gradle deleted file mode 100644 index 3f6f7fd..0000000 --- a/scala-spring/transactions-command-side-web/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'scala' - -dependencies { - compile "org.scala-lang:scala-library:2.10.2" - compile project(":transactions-command-side-backend") - compile project(":common-web") - - testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile scalaTestDependency -} diff --git a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/CommandSideWebTransactionsConfiguration.scala b/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/CommandSideWebTransactionsConfiguration.scala deleted file mode 100644 index 49f1194..0000000 --- a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/CommandSideWebTransactionsConfiguration.scala +++ /dev/null @@ -1,11 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.transactions - -import net.chrisrichardson.eventstore.examples.bank.transactions.TransactionConfiguration -import org.springframework.context.annotation.{ComponentScan, Configuration, Import} - -@Configuration -@Import(Array(classOf[TransactionConfiguration])) -@ComponentScan -class CommandSideWebTransactionsConfiguration { - -} diff --git a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/CreateMoneyTransferResponse.scala b/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/CreateMoneyTransferResponse.scala deleted file mode 100644 index 18ff348..0000000 --- a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/CreateMoneyTransferResponse.scala +++ /dev/null @@ -1,11 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.transactions.controllers - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.examples.bank.transactions.TransferStates - -case class CreateMoneyTransferResponse(transactionId : String) - -case class MoneyTransferRequest(fromAccountId : EntityId, toAccountId : EntityId, amount: BigDecimal) - -case class GetMoneyTransferResponse(transactionId : String, status : String) - diff --git a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/MoneyTransferController.scala b/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/MoneyTransferController.scala deleted file mode 100644 index 7b0575b..0000000 --- a/scala-spring/transactions-command-side-web/src/main/scala/net/chrisrichardson/eventstore/examples/bank/web/transactions/controllers/MoneyTransferController.scala +++ /dev/null @@ -1,30 +0,0 @@ -package net.chrisrichardson.eventstore.examples.bank.web.transactions.controllers - -import net.chrisrichardson.eventstore.EntityId -import net.chrisrichardson.eventstore.EventStore -import net.chrisrichardson.eventstore.examples.bank.backend.common.transactions.TransferDetails -import net.chrisrichardson.eventstore.examples.bank.transactions.{MoneyTransferService, MoneyTransfer} -import net.chrisrichardson.eventstore.examples.bank.web.util.WebUtil -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.web.bind.annotation._ - -import scala.concurrent.ExecutionContext.Implicits.global - -@RestController -class MoneyTransferController @Autowired()(moneyTransferService : MoneyTransferService, - eventStore : EventStore) { - - @RequestMapping(value=Array("/transfers"), method = Array(RequestMethod.POST)) - def create(@RequestBody transferDetails : TransferDetails) = WebUtil.toDeferredResult { - for (transaction <- moneyTransferService.transferMoney(transferDetails)) - yield CreateMoneyTransferResponse(transaction.entityId.id) - } - - @RequestMapping(value=Array("/transfers/{transferId}"), method = Array(RequestMethod.GET)) - def get(@PathVariable transferId : String) = { - val f = eventStore.find[MoneyTransfer](EntityId(transferId)) - WebUtil.toDeferredResult(f map(transactionAggregate => GetMoneyTransferResponse(transferId, transactionAggregate.entity.state.getClass.getSimpleName))) - } - -} - diff --git a/wait-for-docker-services.sh b/wait-for-docker-services.sh deleted file mode 100755 index d9a856f..0000000 --- a/wait-for-docker-services.sh +++ /dev/null @@ -1,9 +0,0 @@ -while [[ true ]]; do - nc -z -w 4 ${SERVICE_HOST?} 8080 && nc -z -w 4 ${SERVICE_HOST?} 8081 && nc -z -w 4 ${SERVICE_HOST?} 8082 - if [[ "$?" -eq "0" ]]; then - echo connected - break - fi - echo -n . - sleep 1 -done \ No newline at end of file diff --git a/wait-for-services.sh b/wait-for-services.sh deleted file mode 100755 index 7107e42..0000000 --- a/wait-for-services.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash - -done=false - -host=$1 -shift -ports=$* - -while [[ "$done" = false ]]; do - for port in $ports; do - curl -q http://${host}:${port}/health >& /dev/null - if [[ "$?" -eq "0" ]]; then - done=true - else - done=false - break - fi - done - if [[ "$done" = true ]]; then - echo connected - break; - fi - #curl -q http://${1?}:8080/health >& /dev/null && curl -q http://${1?}:8081/health >& /dev/null && curl -q http://${1?}:8082/health >& /dev/null - echo -n . - sleep 1 -done