You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by aw...@apache.org on 2019/04/30 08:24:36 UTC
[fineract-cn-group] 02/40: Changing name of GroupManager.
This is an automated email from the ASF dual-hosted git repository.
awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-group.git
commit 6cc0359265164844a91ab50407136df3de6b2407
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Fri Mar 17 18:12:38 2017 +0100
Changing name of GroupManager.
---
HEADER | 2 +-
.../client/{GroupClient.java => GroupManager.java} | 2 +-
build.gradle | 7 +++
.../src/main/java/io/mifos/group/TestGroup.java | 50 +++++++++++-----------
.../java/io/mifos/group/TestGroupDefinition.java | 8 ++--
shared.gradle | 10 ++++-
6 files changed, 46 insertions(+), 33 deletions(-)
diff --git a/HEADER b/HEADER
index 76f9222..4b2eadf 100644
--- a/HEADER
+++ b/HEADER
@@ -1,4 +1,4 @@
-Copyright ${year} ${name}
+Copyright ${year} ${name}.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/api/src/main/java/io/mifos/group/api/v1/client/GroupClient.java b/api/src/main/java/io/mifos/group/api/v1/client/GroupManager.java
similarity index 99%
rename from api/src/main/java/io/mifos/group/api/v1/client/GroupClient.java
rename to api/src/main/java/io/mifos/group/api/v1/client/GroupManager.java
index f1e44b9..63f2075 100644
--- a/api/src/main/java/io/mifos/group/api/v1/client/GroupClient.java
+++ b/api/src/main/java/io/mifos/group/api/v1/client/GroupManager.java
@@ -40,7 +40,7 @@ import java.util.Set;
@SuppressWarnings("unused")
@FeignClient(name="group-v1", path="/group/v1", configuration=CustomFeignClientsConfiguration.class)
-public interface GroupClient {
+public interface GroupManager {
@RequestMapping(
value = "/definitions",
diff --git a/build.gradle b/build.gradle
index b8c09e6..b30bd55 100644
--- a/build.gradle
+++ b/build.gradle
@@ -27,3 +27,10 @@ task prepareForTest {
dependsOn publishToMavenLocal
dependsOn gradle.includedBuild('component-test').task(':build')
}
+
+task licenseFormat {
+ group 'all'
+ dependsOn gradle.includedBuild('api').task(':licenseFormat')
+ dependsOn gradle.includedBuild('service').task(':licenseFormat')
+ dependsOn gradle.includedBuild('component-test').task(':licenseFormat')
+}
diff --git a/component-test/src/main/java/io/mifos/group/TestGroup.java b/component-test/src/main/java/io/mifos/group/TestGroup.java
index 91110f9..caa15ed 100644
--- a/component-test/src/main/java/io/mifos/group/TestGroup.java
+++ b/component-test/src/main/java/io/mifos/group/TestGroup.java
@@ -24,7 +24,7 @@ import io.mifos.core.test.fixture.mariadb.MariaDBInitializer;
import io.mifos.core.test.listener.EnableEventRecording;
import io.mifos.core.test.listener.EventRecorder;
import io.mifos.group.api.v1.EventConstants;
-import io.mifos.group.api.v1.client.GroupClient;
+import io.mifos.group.api.v1.client.GroupManager;
import io.mifos.group.api.v1.domain.AssignedEmployeeHolder;
import io.mifos.group.api.v1.domain.Attendee;
import io.mifos.group.api.v1.domain.Group;
@@ -81,7 +81,7 @@ public class TestGroup {
public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment
= new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize);
@Autowired
- private GroupClient groupClient;
+ private GroupManager testSubject;
@Autowired
private EventRecorder eventRecorder;
@@ -113,17 +113,17 @@ public class TestGroup {
public void shouldCreateGroup() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
- this.groupClient.createGroup(randomGroup);
+ this.testSubject.createGroup(randomGroup);
this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());
- final Group fetchedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group fetchedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals(randomGroup.getIdentifier(), fetchedGroup.getIdentifier());
Assert.assertEquals(randomGroup.getGroupDefinitionIdentifier(), fetchedGroup.getGroupDefinitionIdentifier());
Assert.assertEquals(randomGroup.getName(), fetchedGroup.getName());
@@ -143,14 +143,14 @@ public class TestGroup {
@Test
public void shouldActivateCommand() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
- this.groupClient.createGroup(randomGroup);
+ this.testSubject.createGroup(randomGroup);
this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());
- final Group fetchedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group fetchedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals(Group.Status.PENDING.name(), fetchedGroup.getStatus());
final GroupCommand activate = new GroupCommand();
@@ -159,13 +159,13 @@ public class TestGroup {
activate.setCreatedBy(TestGroup.TEST_USER);
activate.setCreatedOn(ZonedDateTime.now(Clock.systemUTC()).format(DateTimeFormatter.ISO_ZONED_DATE_TIME));
- this.groupClient.processGroupCommand(randomGroup.getIdentifier(), activate);
+ this.testSubject.processGroupCommand(randomGroup.getIdentifier(), activate);
this.eventRecorder.wait(EventConstants.ACTIVATE_GROUP, randomGroup.getIdentifier());
- final Group activatedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group activatedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals(Group.Status.ACTIVE.name(), activatedGroup.getStatus());
- final List<GroupCommand> groupCommands = this.groupClient.fetchGroupCommands(activatedGroup.getIdentifier());
+ final List<GroupCommand> groupCommands = this.testSubject.fetchGroupCommands(activatedGroup.getIdentifier());
Assert.assertTrue(groupCommands.size() == 1);
final GroupCommand groupCommand = groupCommands.get(0);
Assert.assertEquals(activate.getAction(), groupCommand.getAction());
@@ -173,7 +173,7 @@ public class TestGroup {
Assert.assertEquals(activate.getCreatedBy(), groupCommand.getCreatedBy());
Assert.assertNotNull(groupCommand.getCreatedOn());
- final List<Meeting> meetings = this.groupClient.fetchMeetings(activatedGroup.getIdentifier(), Boolean.FALSE);
+ final List<Meeting> meetings = this.testSubject.fetchMeetings(activatedGroup.getIdentifier(), Boolean.FALSE);
Assert.assertNotNull(meetings);
Assert.assertEquals(randomGroupDefinition.getCycle().getNumberOfMeetings(), Integer.valueOf(meetings.size()));
@@ -191,37 +191,37 @@ public class TestGroup {
.collect(Collectors.toSet())
);
- this.groupClient.closeMeeting(activatedGroup.getIdentifier(), signOffMeeting);
+ this.testSubject.closeMeeting(activatedGroup.getIdentifier(), signOffMeeting);
this.eventRecorder.wait(EventConstants.PUT_GROUP, activatedGroup.getIdentifier());
}
@Test
public void shouldUpdateLeaders() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
- this.groupClient.createGroup(randomGroup);
+ this.testSubject.createGroup(randomGroup);
this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());
final int currentLeadersSize = randomGroup.getLeaders().size();
randomGroup.getLeaders().add(RandomStringUtils.randomAlphanumeric(32));
- this.groupClient.updateLeaders(randomGroup.getIdentifier(), randomGroup.getLeaders());
+ this.testSubject.updateLeaders(randomGroup.getIdentifier(), randomGroup.getLeaders());
this.eventRecorder.wait(EventConstants.PUT_GROUP, randomGroup.getIdentifier());
- final Group fetchedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group fetchedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals((currentLeadersSize + 1), fetchedGroup.getLeaders().size());
}
@Test
public void shouldUpdateMembers() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
- this.groupClient.createGroup(randomGroup);
+ this.testSubject.createGroup(randomGroup);
this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());
final int currentMembersSize = randomGroup.getMembers().size();
@@ -229,30 +229,30 @@ public class TestGroup {
RandomStringUtils.randomAlphanumeric(32),
RandomStringUtils.randomAlphanumeric(32)
));
- this.groupClient.updateMembers(randomGroup.getIdentifier(), randomGroup.getMembers());
+ this.testSubject.updateMembers(randomGroup.getIdentifier(), randomGroup.getMembers());
this.eventRecorder.wait(EventConstants.PUT_GROUP, randomGroup.getIdentifier());
- final Group fetchedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group fetchedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals((currentMembersSize + 2), fetchedGroup.getMembers().size());
}
@Test
public void shouldUpdateAssignedEmployee() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
- this.groupClient.createGroup(randomGroup);
+ this.testSubject.createGroup(randomGroup);
this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());
final AssignedEmployeeHolder anotherEmployee = new AssignedEmployeeHolder();
anotherEmployee.setIdentifier(RandomStringUtils.randomAlphanumeric(32));
- this.groupClient.updateAssignedEmployee(randomGroup.getIdentifier(), anotherEmployee);
+ this.testSubject.updateAssignedEmployee(randomGroup.getIdentifier(), anotherEmployee);
this.eventRecorder.wait(EventConstants.PUT_GROUP, randomGroup.getIdentifier());
- final Group fetchedGroup = this.groupClient.findGroup(randomGroup.getIdentifier());
+ final Group fetchedGroup = this.testSubject.findGroup(randomGroup.getIdentifier());
Assert.assertEquals(anotherEmployee.getIdentifier(), fetchedGroup.getAssignedEmployee());
}
diff --git a/component-test/src/main/java/io/mifos/group/TestGroupDefinition.java b/component-test/src/main/java/io/mifos/group/TestGroupDefinition.java
index b33ad72..18b7203 100644
--- a/component-test/src/main/java/io/mifos/group/TestGroupDefinition.java
+++ b/component-test/src/main/java/io/mifos/group/TestGroupDefinition.java
@@ -25,7 +25,7 @@ import io.mifos.core.test.fixture.mariadb.MariaDBInitializer;
import io.mifos.core.test.listener.EnableEventRecording;
import io.mifos.core.test.listener.EventRecorder;
import io.mifos.group.api.v1.EventConstants;
-import io.mifos.group.api.v1.client.GroupClient;
+import io.mifos.group.api.v1.client.GroupManager;
import io.mifos.group.api.v1.domain.GroupDefinition;
import io.mifos.group.service.GroupConfiguration;
import io.mifos.group.util.GroupDefinitionGenerator;
@@ -68,7 +68,7 @@ public class TestGroupDefinition {
= new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize);
@Autowired
- private GroupClient groupClient;
+ private GroupManager testSubject;
@Autowired
private EventRecorder eventRecorder;
@@ -100,11 +100,11 @@ public class TestGroupDefinition {
@Test
public void shouldCreateGroupDefinition() throws Exception {
final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
- this.groupClient.createGroupDefinition(randomGroupDefinition);
+ this.testSubject.createGroupDefinition(randomGroupDefinition);
this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());
- final GroupDefinition fetchedGroupDefinition = this.groupClient.findGroupDefinition(randomGroupDefinition.getIdentifier());
+ final GroupDefinition fetchedGroupDefinition = this.testSubject.findGroupDefinition(randomGroupDefinition.getIdentifier());
Assert.assertEquals(randomGroupDefinition.getIdentifier(), fetchedGroupDefinition.getIdentifier());
Assert.assertEquals(randomGroupDefinition.getDescription(), fetchedGroupDefinition.getDescription());
diff --git a/shared.gradle b/shared.gradle
index c54ad58..79a8238 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -18,8 +18,10 @@ apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'io.spring.dependency-management'
-sourceCompatibility = JavaVersion.VERSION_1_8
-targetCompatibility = JavaVersion.VERSION_1_8
+tasks.withType(JavaCompile) {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+}
repositories {
jcenter()
@@ -49,6 +51,10 @@ dependencies {
)
}
+jar {
+ from sourceSets.main.allSource
+}
+
license {
header rootProject.file('../HEADER')
strictCheck true