This is an automated email from the ASF dual-hosted git repository.

myrle pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-demo-server.git

commit f536d56f30f438801c83581ec509224e20084d68
Author: mgeiss <[email protected]>
AuthorDate: Tue Aug 15 15:52:54 2017 +0200

    added missing services
    fixed retrieving of csv resources
---
 build.gradle                                       |  4 ++
 src/main/java/io/mifos/dev/ServiceRunner.java      | 29 ++++++++++++--
 .../listener/DepositAccountManagementListener.java | 46 ++++++++++++++++++++++
 .../io/mifos/dev/listener/ReportingListener.java   | 46 ++++++++++++++++++++++
 .../java/io/mifos/dev/listener/TellerListener.java | 46 ++++++++++++++++++++++
 5 files changed, 168 insertions(+), 3 deletions(-)

diff --git a/build.gradle b/build.gradle
index 1a799a1..75e1ac8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,6 +30,8 @@ ext.versions = [
         mifosaccounting         : '0.1.0-BUILD-SNAPSHOT',
         mifosportfolio          : '0.1.0-BUILD-SNAPSHOT',
         mifosdeposit            : '0.1.0-BUILD-SNAPSHOT',
+        mifosteller             : '0.1.0-BUILD-SNAPSHOT',
+        mifosreporting          : '0.1.0-BUILD-SNAPSHOT',
         frameworkapi            : '0.1.0-BUILD-SNAPSHOT',
         frameworklang           : '0.1.0-BUILD-SNAPSHOT',
         frameworktest           : '0.1.0-BUILD-SNAPSHOT',
@@ -82,6 +84,8 @@ dependencies {
             [group: 'io.mifos.accounting', name: 'importer', version: 
versions.mifosaccounting],
             [group: 'io.mifos.portfolio', name: 'api', version: 
versions.mifosportfolio],
             [group: 'io.mifos.deposit-account-management', name: 'api', 
version: versions.mifosdeposit],
+            [group: 'io.mifos.teller', name: 'api', version: 
versions.mifosteller],
+            [group: 'io.mifos.reporting', name: 'api', version: 
versions.mifosreporting],
 
             [group: 'io.mifos.anubis', name: 'api', version: 
versions.frameworkanubis],
             [group: 'io.mifos.anubis', name: 'test', version: 
versions.frameworkanubis],
diff --git a/src/main/java/io/mifos/dev/ServiceRunner.java 
b/src/main/java/io/mifos/dev/ServiceRunner.java
index e74ee28..3c62613 100644
--- a/src/main/java/io/mifos/dev/ServiceRunner.java
+++ b/src/main/java/io/mifos/dev/ServiceRunner.java
@@ -49,8 +49,10 @@ import io.mifos.office.api.v1.client.OrganizationManager;
 import io.mifos.portfolio.api.v1.client.PortfolioManager;
 import io.mifos.provisioner.api.v1.client.Provisioner;
 import io.mifos.provisioner.api.v1.domain.*;
+import io.mifos.reporting.api.v1.client.ReportManager;
 import io.mifos.rhythm.api.v1.client.RhythmManager;
 import io.mifos.rhythm.api.v1.events.BeatEvent;
+import io.mifos.teller.api.v1.client.TellerManager;
 import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
 import org.eclipse.aether.resolution.ArtifactResolutionException;
 import org.junit.*;
@@ -97,6 +99,9 @@ public class ServiceRunner {
   private static Microservice<LedgerManager> ledgerManager;
   private static Microservice<PortfolioManager> portfolioManager;
   private static Microservice<DepositAccountManager> depositAccountManager;
+  private static Microservice<TellerManager> tellerManager;
+  private static Microservice<ReportManager> reportManager;
+
 
   private static DB embeddedMariaDb;
 
@@ -208,10 +213,18 @@ public class ServiceRunner {
 
     ServiceRunner.depositAccountManager = new 
Microservice<>(DepositAccountManager.class, "deposit-account-management", 
"0.1.0-BUILD-SNAPSHOT", ServiceRunner.INTEGRATION_TEST_ENVIRONMENT);
     startService(generalProperties, depositAccountManager);
+
+    ServiceRunner.tellerManager = new Microservice<>(TellerManager.class, 
"teller", "0.1.0-BUILD-SNAPSHOT", ServiceRunner.INTEGRATION_TEST_ENVIRONMENT);
+    startService(generalProperties, ServiceRunner.tellerManager);
+
+    ServiceRunner.reportManager = new Microservice<>(ReportManager.class, 
"reporting", "0.1.0-BUILD-SNAPSHOT", 
ServiceRunner.INTEGRATION_TEST_ENVIRONMENT);
+    startService(generalProperties, ServiceRunner.reportManager);
   }
 
   @After
   public void tearDown() throws Exception {
+    ServiceRunner.reportManager.kill();
+    ServiceRunner.tellerManager.kill();
     ServiceRunner.depositAccountManager.kill();
     ServiceRunner.rhythmManager.kill();
     ServiceRunner.portfolioManager.kill();
@@ -245,6 +258,8 @@ public class ServiceRunner {
     System.out.println("Accounting Service: " + 
ServiceRunner.ledgerManager.getProcessEnvironment().serverURI());
     System.out.println("Portfolio Service: " + 
ServiceRunner.portfolioManager.getProcessEnvironment().serverURI());
     System.out.println("Deposit Service: " + 
ServiceRunner.depositAccountManager.getProcessEnvironment().serverURI());
+    System.out.println("Teller Service: " + 
ServiceRunner.tellerManager.getProcessEnvironment().serverURI());
+    System.out.println("Reporting Service: " + 
ServiceRunner.reportManager.getProcessEnvironment().serverURI());
 
     boolean run = true;
 
@@ -303,7 +318,9 @@ public class ServiceRunner {
             ApplicationBuilder.create(ServiceRunner.customerManager.name(), 
ServiceRunner.customerManager.uri()),
             ApplicationBuilder.create(ServiceRunner.ledgerManager.name(), 
ServiceRunner.ledgerManager.uri()),
             ApplicationBuilder.create(ServiceRunner.portfolioManager.name(), 
ServiceRunner.portfolioManager.uri()),
-            
ApplicationBuilder.create(ServiceRunner.depositAccountManager.name(), 
ServiceRunner.depositAccountManager.uri())
+            
ApplicationBuilder.create(ServiceRunner.depositAccountManager.name(), 
ServiceRunner.depositAccountManager.uri()),
+            ApplicationBuilder.create(ServiceRunner.tellerManager.name(), 
ServiceRunner.tellerManager.uri()),
+            ApplicationBuilder.create(ServiceRunner.reportManager.name(), 
ServiceRunner.reportManager.uri())
     );
 
     final List<Tenant> tenantsToCreate = Arrays.asList(
@@ -362,6 +379,8 @@ public class ServiceRunner {
         
Assert.assertTrue(this.eventRecorder.wait(EventConstants.OPERATION_PUT_APPLICATION_PERMISSION_USER_ENABLED,
 new ApplicationPermissionUserEvent(rhythmManager.name(), 
io.mifos.identity.api.v1.PermittableGroupIds.APPLICATION_SELF_MANAGEMENT, 
schedulerUser.getIdentifier())));
       }
 
+      provisionApp(tenant, ServiceRunner.organizationManager, 
io.mifos.office.api.v1.EventConstants.INITIALIZE);
+
       provisionApp(tenant, ledgerManager, 
io.mifos.accounting.api.v1.EventConstants.INITIALIZE);
 
       provisionApp(tenant, portfolioManager, 
io.mifos.portfolio.api.v1.events.EventConstants.INITIALIZE);
@@ -394,6 +413,10 @@ public class ServiceRunner {
 
       provisionApp(tenant, depositAccountManager, 
io.mifos.deposit.api.v1.EventConstants.INITIALIZE);
 
+      provisionApp(tenant, ServiceRunner.tellerManager, 
io.mifos.teller.api.v1.EventConstants.INITIALIZE);
+
+      provisionApp(tenant, ServiceRunner.reportManager, 
io.mifos.reporting.api.v1.EventConstants.INITIALIZE);
+
       final UserWithPassword orgAdminUserPassword = 
createOrgAdminRoleAndUser(tenantAdminPassword.getAdminPassword());
 
       createChartOfAccounts(orgAdminUserPassword);
@@ -410,12 +433,12 @@ public class ServiceRunner {
 
     try (final AutoUserContext ignored = new 
AutoUserContext(userWithPassword.getIdentifier(), 
authentication.getAccessToken())) {
       final LedgerImporter ledgerImporter = new 
LedgerImporter(ledgerManager.api(), logger);
-      final URL ledgersUrl = 
ClassLoader.getSystemResource("standardChartOfAccounts/ledgers.csv");
+      final URL ledgersUrl = 
ServiceRunner.class.getResource("/standardChartOfAccounts/ledgers.csv");
       ledgerImporter.importCSV(ledgersUrl);
       Assert.assertTrue(this.eventRecorder.wait(POST_LEDGER, 
LOAN_INCOME_LEDGER));
 
       final AccountImporter accountImporter = new 
AccountImporter(ledgerManager.api(), logger);
-      final URL accountsUrl = 
ClassLoader.getSystemResource("standardChartOfAccounts/accounts.csv");
+      final URL accountsUrl = 
ServiceRunner.class.getResource("/standardChartOfAccounts/accounts.csv");
       accountImporter.importCSV(accountsUrl);
       Assert.assertTrue(this.eventRecorder.wait(POST_ACCOUNT, "9330"));
 
diff --git 
a/src/main/java/io/mifos/dev/listener/DepositAccountManagementListener.java 
b/src/main/java/io/mifos/dev/listener/DepositAccountManagementListener.java
new file mode 100644
index 0000000..174859b
--- /dev/null
+++ b/src/main/java/io/mifos/dev/listener/DepositAccountManagementListener.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.dev.listener;
+
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+import io.mifos.deposit.api.v1.EventConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+@SuppressWarnings("unused")
+@Component
+public class DepositAccountManagementListener {
+
+  private final EventRecorder eventRecorder;
+
+  @Autowired
+  public DepositAccountManagementListener(final EventRecorder eventRecorder) {
+    this.eventRecorder = eventRecorder;
+  }
+
+  @JmsListener(
+      subscription = EventConstants.DESTINATION,
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_INITIALIZE
+  )
+  public void onInitialized(@Header(TenantHeaderFilter.TENANT_HEADER) final 
String tenant,
+                            final String payload) {
+    this.eventRecorder.event(tenant, EventConstants.INITIALIZE, payload, 
String.class);
+  }
+}
diff --git a/src/main/java/io/mifos/dev/listener/ReportingListener.java 
b/src/main/java/io/mifos/dev/listener/ReportingListener.java
new file mode 100644
index 0000000..c9147f1
--- /dev/null
+++ b/src/main/java/io/mifos/dev/listener/ReportingListener.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.dev.listener;
+
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+import io.mifos.reporting.api.v1.EventConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+@SuppressWarnings("unused")
+@Component
+public class ReportingListener {
+
+  private final EventRecorder eventRecorder;
+
+  @Autowired
+  public ReportingListener(final EventRecorder eventRecorder) {
+    this.eventRecorder = eventRecorder;
+  }
+
+  @JmsListener(
+      subscription = EventConstants.DESTINATION,
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_INITIALIZE
+  )
+  public void onInitialized(@Header(TenantHeaderFilter.TENANT_HEADER) final 
String tenant,
+                            final String payload) {
+    this.eventRecorder.event(tenant, EventConstants.INITIALIZE, payload, 
String.class);
+  }
+}
diff --git a/src/main/java/io/mifos/dev/listener/TellerListener.java 
b/src/main/java/io/mifos/dev/listener/TellerListener.java
new file mode 100644
index 0000000..c5c5315
--- /dev/null
+++ b/src/main/java/io/mifos/dev/listener/TellerListener.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.dev.listener;
+
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+import io.mifos.teller.api.v1.EventConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+@SuppressWarnings("unused")
+@Component
+public class TellerListener {
+
+  private final EventRecorder eventRecorder;
+
+  @Autowired
+  public TellerListener(final EventRecorder eventRecorder) {
+    this.eventRecorder = eventRecorder;
+  }
+
+  @JmsListener(
+      subscription = EventConstants.DESTINATION,
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_INITIALIZE
+  )
+  public void onInitialized(@Header(TenantHeaderFilter.TENANT_HEADER) final 
String tenant,
+                            final String payload) {
+    this.eventRecorder.event(tenant, EventConstants.INITIALIZE, payload, 
String.class);
+  }
+}

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to