kengneruphine closed pull request #9: Adding group service to demo server
URL: https://github.com/apache/fineract-cn-demo-server/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.project b/.project
new file mode 100644
index 0000000..df5a340
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>demo-server</name>
+       <comment>Project demo-server created by Buildship.</comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+       </natures>
+</projectDescription>
diff --git a/build.gradle b/build.gradle
index d1db301..0e9f444 100644
--- a/build.gradle
+++ b/build.gradle
@@ -34,6 +34,7 @@ ext.versions = [
         mifosreporting          : '0.1.0-BUILD-SNAPSHOT',
         kuelapcheques           : '0.1.0-BUILD-SNAPSHOT',
         mifospayroll            : '0.1.0-BUILD-SNAPSHOT',
+        mifosgroup              : '0.1.0-BUILD-SNAPSHOT',
         frameworkapi            : '0.1.0-BUILD-SNAPSHOT',
         frameworklang           : '0.1.0-BUILD-SNAPSHOT',
         frameworktest           : '0.1.0-BUILD-SNAPSHOT',
@@ -90,6 +91,7 @@ dependencies {
             [group: 'org.apache.fineract.cn.reporting', name: 'api', version: 
versions.mifosreporting],
             [group: 'org.apache.fineract.cn.cheques', name: 'api', version: 
versions.kuelapcheques],
             [group: 'org.apache.fineract.cn.payroll', name: 'api', version: 
versions.mifospayroll],
+            [group: 'org.apache.fineract.cn.group', name: 'api', version: 
versions.mifosgroup],
 
             [group: 'org.apache.fineract.cn.anubis', name: 'api', version: 
versions.frameworkanubis],
             [group: 'org.apache.fineract.cn.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 59863dd..e28e657 100644
--- a/src/main/java/io/mifos/dev/ServiceRunner.java
+++ b/src/main/java/io/mifos/dev/ServiceRunner.java
@@ -44,6 +44,7 @@
 import io.mifos.customer.api.v1.CustomerEventConstants;
 import io.mifos.customer.api.v1.client.CustomerManager;
 import io.mifos.deposit.api.v1.client.DepositAccountManager;
+import io.mifos.group.api.v1.client.GroupManager;
 import io.mifos.identity.api.v1.client.IdentityManager;
 import io.mifos.identity.api.v1.domain.*;
 import io.mifos.identity.api.v1.events.ApplicationPermissionEvent;
@@ -109,6 +110,7 @@
   private static Microservice<ReportManager> reportManager;
   private static Microservice<ChequeManager> chequeManager;
   private static Microservice<PayrollManager> payrollManager;
+  private static Microservice<GroupManager> groupManager;
 
 
   private static DB embeddedMariaDb;
@@ -234,10 +236,14 @@ public void before() throws Exception
 
     ServiceRunner.payrollManager = new Microservice<>(PayrollManager.class, 
"payroll", "0.1.0-BUILD-SNAPSHOT", ServiceRunner.INTEGRATION_TEST_ENVIRONMENT);
     startService(generalProperties, ServiceRunner.payrollManager);
+
+    ServiceRunner.groupManager = new Microservice<>(GroupManager.class, 
"group", "0.1.0-BUILD-SNAPSHOT", ServiceRunner.INTEGRATION_TEST_ENVIRONMENT);
+    startService(generalProperties, ServiceRunner.groupManager);
   }
 
   @After
   public void tearDown() throws Exception {
+    ServiceRunner.groupManager.kill();
     ServiceRunner.payrollManager.kill();
     ServiceRunner.chequeManager.kill();
     ServiceRunner.reportManager.kill();
@@ -279,6 +285,7 @@ public void startDevServer() throws InterruptedException, 
IOException, ArtifactR
     System.out.println("Reporting Service: " + 
ServiceRunner.reportManager.getProcessEnvironment().serverURI());
     System.out.println("Cheque Service: " + 
ServiceRunner.chequeManager.getProcessEnvironment().serverURI());
     System.out.println("Payroll Service: " + 
ServiceRunner.payrollManager.getProcessEnvironment().serverURI());
+    System.out.println("Group Service: " + 
ServiceRunner.groupManager.getProcessEnvironment().serverURI());
 
     boolean run = true;
 
@@ -341,9 +348,11 @@ private void provisionAppsViaSeshat() throws 
InterruptedException, IOException {
             ApplicationBuilder.create(ServiceRunner.tellerManager.name(), 
ServiceRunner.tellerManager.uri()),
             ApplicationBuilder.create(ServiceRunner.reportManager.name(), 
ServiceRunner.reportManager.uri()),
             ApplicationBuilder.create(ServiceRunner.chequeManager.name(), 
ServiceRunner.chequeManager.uri()),
-            ApplicationBuilder.create(ServiceRunner.payrollManager.name(), 
ServiceRunner.payrollManager.uri())
+            ApplicationBuilder.create(ServiceRunner.payrollManager.name(), 
ServiceRunner.payrollManager.uri()),
+            ApplicationBuilder.create(ServiceRunner.groupManager.name(), 
ServiceRunner.groupManager.uri())
     );
 
+
     final List<Tenant> tenantsToCreate = Arrays.asList(
         
TenantBuilder.create(ServiceRunner.provisionerService.getProcessEnvironment(), 
"playground", "A place to mess around and have fun", "playground")
         
//TenantBuilder.create(ServiceRunner.provisionerService.getProcessEnvironment(),
 "demo-cccu", "Demo for CCCU", "demo_cccu"),
diff --git a/src/main/java/io/mifos/dev/listener/GroupListener.java 
b/src/main/java/io/mifos/dev/listener/GroupListener.java
new file mode 100644
index 0000000..8789361
--- /dev/null
+++ b/src/main/java/io/mifos/dev/listener/GroupListener.java
@@ -0,0 +1,35 @@
+package io.mifos.dev.listener;
+
+import io.mifos.group.api.v1.EventConstants;
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+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;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings("unused")
+@Component
+public class GroupListener {
+
+    private final EventRecorder eventRecorder;
+
+    @Autowired
+    public GroupListener(final EventRecorder eventRecorder) {
+        this.eventRecorder = eventRecorder;
+    }
+
+    @JmsListener(
+            destination = EventConstants.DESTINATION,
+            selector = EventConstants.SELECTOR_INITIALIZE,
+            subscription = EventConstants.DESTINATION
+    )
+    public void onInitialization(@Header(TenantHeaderFilter.TENANT_HEADER) 
final String tenant,
+                                 final String payload) {
+        this.eventRecorder.event(tenant, EventConstants.INITIALIZE, payload, 
String.class);
+    }
+}
+


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to