replace 51013 Tabs with 4 Spaces in 3122 Java files (FINERACT-821)
rpl -eRxjava "\t" " " .
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
68006ae8f2
commit
b0196049f1
+4
-4
@@ -23,8 +23,8 @@ import org.springframework.util.Assert;
|
||||
|
||||
public class AccountingConstantsTest {
|
||||
|
||||
@Test
|
||||
public void testGetAllFinancialActivities() {
|
||||
Assert.notEmpty(AccountingConstants.FINANCIAL_ACTIVITY.getAllFinancialActivities(), "static initialization of collection of all enums is broken");
|
||||
}
|
||||
@Test
|
||||
public void testGetAllFinancialActivities() {
|
||||
Assert.notEmpty(AccountingConstants.FINANCIAL_ACTIVITY.getAllFinancialActivities(), "static initialization of collection of all enums is broken");
|
||||
}
|
||||
}
|
||||
|
||||
+22
-22
@@ -34,36 +34,36 @@ import com.jayway.restassured.specification.ResponseSpecification;
|
||||
*/
|
||||
public class RestAssuredFixture {
|
||||
|
||||
private final int httpPort;
|
||||
private final int httpPort;
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
public RestAssuredFixture(int httpPort) {
|
||||
super();
|
||||
this.httpPort = httpPort;
|
||||
Utils.initializeRESTAssured();
|
||||
RestAssured.port = httpPort;
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
public RestAssuredFixture(int httpPort) {
|
||||
super();
|
||||
this.httpPort = httpPort;
|
||||
Utils.initializeRESTAssured();
|
||||
RestAssured.port = httpPort;
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
public <T> T httpGet(String apiPath, String jsonAttributeToGetBack) {
|
||||
return Utils.performServerGet(this.requestSpec, this.responseSpec, getApiPath(apiPath), jsonAttributeToGetBack);
|
||||
}
|
||||
public <T> T httpGet(String apiPath, String jsonAttributeToGetBack) {
|
||||
return Utils.performServerGet(this.requestSpec, this.responseSpec, getApiPath(apiPath), jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
public <T> T httpGet(String apiPath) {
|
||||
return httpGet(apiPath, "");
|
||||
}
|
||||
public <T> T httpGet(String apiPath) {
|
||||
return httpGet(apiPath, "");
|
||||
}
|
||||
|
||||
private String getApiPath(String apiPath) {
|
||||
private String getApiPath(String apiPath) {
|
||||
Preconditions.checkArgument(apiPath.startsWith("/"), "trailingApiUrl must start with slash: " + apiPath);
|
||||
return "/fineract-provider/api/v1" + apiPath + "?tenantIdentifier=default";
|
||||
}
|
||||
}
|
||||
|
||||
protected String getApiUrl(String apiPath) {
|
||||
return "http://localhost:" + httpPort + getApiPath(apiPath);
|
||||
protected String getApiUrl(String apiPath) {
|
||||
return "http://localhost:" + httpPort + getApiPath(apiPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,8 +31,8 @@ import org.springframework.test.context.web.WebAppConfiguration;
|
||||
@ActiveProfiles("basicauth")
|
||||
public abstract class AbstractSpringBootWithMariaDB4jIntegrationTest {
|
||||
|
||||
// do NOT put any helper methods here!
|
||||
// it's much better to use composition instead of inheritance
|
||||
// so write a test util ("fixture") and use it as a field in your test
|
||||
// do NOT put any helper methods here!
|
||||
// it's much better to use composition instead of inheritance
|
||||
// so write a test util ("fixture") and use it as a field in your test
|
||||
|
||||
}
|
||||
|
||||
@@ -43,68 +43,68 @@ import org.mockito.Mock;
|
||||
@org.junit.Ignore // see FINERACT-776
|
||||
public class TopicTest {
|
||||
|
||||
@Mock
|
||||
private OfficeRepository officeRepository;
|
||||
|
||||
@Mock
|
||||
private RoleRepository roleRepository;
|
||||
|
||||
@Mock
|
||||
private TopicWritePlatformService topicWritePltfService;
|
||||
|
||||
@Mock
|
||||
private TopicRepository topicRepository;
|
||||
|
||||
@Mock
|
||||
private TopicSubscriberWritePlatformService topicSubscriberWritePltfService;
|
||||
|
||||
@Mock
|
||||
private AppUserRepository appUserRepository;
|
||||
|
||||
@Test
|
||||
public void testTopicStorage() {
|
||||
Office office = officeRepository.getOne(1L);
|
||||
Role role = new Role("New Member_Type", "Testing topic creation");
|
||||
|
||||
String title = role.getName() + " of " + office.getName();
|
||||
Long entityId = office.getId();
|
||||
@Mock
|
||||
private OfficeRepository officeRepository;
|
||||
|
||||
@Mock
|
||||
private RoleRepository roleRepository;
|
||||
|
||||
@Mock
|
||||
private TopicWritePlatformService topicWritePltfService;
|
||||
|
||||
@Mock
|
||||
private TopicRepository topicRepository;
|
||||
|
||||
@Mock
|
||||
private TopicSubscriberWritePlatformService topicSubscriberWritePltfService;
|
||||
|
||||
@Mock
|
||||
private AppUserRepository appUserRepository;
|
||||
|
||||
@Test
|
||||
public void testTopicStorage() {
|
||||
Office office = officeRepository.getOne(1L);
|
||||
Role role = new Role("New Member_Type", "Testing topic creation");
|
||||
|
||||
String title = role.getName() + " of " + office.getName();
|
||||
Long entityId = office.getId();
|
||||
String entityType = "";
|
||||
if (office.getParent() == null) {
|
||||
entityType = "OFFICE";
|
||||
entityType = "OFFICE";
|
||||
} else {
|
||||
entityType = "BRANCH";
|
||||
entityType = "BRANCH";
|
||||
}
|
||||
Topic topic = new Topic(title, true, entityId, entityType, role.getName().toUpperCase());
|
||||
Topic topic = new Topic(title, true, entityId, entityType, role.getName().toUpperCase());
|
||||
|
||||
when(this.officeRepository.getOne(1L)).thenReturn(office);
|
||||
when(this.roleRepository.save(role)).thenReturn(role);
|
||||
when(this.topicWritePltfService.create(refEq(topic))).thenReturn(1L);
|
||||
|
||||
this.roleRepository.save(role);
|
||||
Long topicId = this.topicWritePltfService.create(topic);
|
||||
|
||||
verify(this.roleRepository, times(1)).save(role);
|
||||
verify(this.topicWritePltfService, times(1)).create(refEq(topic));
|
||||
assertEquals(topicId, new Long(1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTopicSubscriberStorage() {
|
||||
AppUser user = appUserRepository.findById(1L).get();
|
||||
Topic topic = topicRepository.findById(1L).get();
|
||||
|
||||
TopicSubscriber topicSubscriber = new TopicSubscriber(topic, user, new Date());
|
||||
|
||||
when(this.appUserRepository.getOne(1L)).thenReturn(user);
|
||||
when(this.topicRepository.getOne(1L)).thenReturn(topic);
|
||||
when(this.topicSubscriberWritePltfService.create(refEq(topicSubscriber))).thenReturn(1L);
|
||||
|
||||
Long subscriberId = this.topicSubscriberWritePltfService.create(topicSubscriber);
|
||||
|
||||
verify(this.topicSubscriberWritePltfService, times(1)).create(refEq(topicSubscriber));
|
||||
assertEquals(subscriberId, new Long(1));
|
||||
|
||||
}
|
||||
|
||||
when(this.officeRepository.getOne(1L)).thenReturn(office);
|
||||
when(this.roleRepository.save(role)).thenReturn(role);
|
||||
when(this.topicWritePltfService.create(refEq(topic))).thenReturn(1L);
|
||||
|
||||
this.roleRepository.save(role);
|
||||
Long topicId = this.topicWritePltfService.create(topic);
|
||||
|
||||
verify(this.roleRepository, times(1)).save(role);
|
||||
verify(this.topicWritePltfService, times(1)).create(refEq(topic));
|
||||
assertEquals(topicId, new Long(1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTopicSubscriberStorage() {
|
||||
AppUser user = appUserRepository.findById(1L).get();
|
||||
Topic topic = topicRepository.findById(1L).get();
|
||||
|
||||
TopicSubscriber topicSubscriber = new TopicSubscriber(topic, user, new Date());
|
||||
|
||||
when(this.appUserRepository.getOne(1L)).thenReturn(user);
|
||||
when(this.topicRepository.getOne(1L)).thenReturn(topic);
|
||||
when(this.topicSubscriberWritePltfService.create(refEq(topicSubscriber))).thenReturn(1L);
|
||||
|
||||
Long subscriberId = this.topicSubscriberWritePltfService.create(topicSubscriber);
|
||||
|
||||
verify(this.topicSubscriberWritePltfService, times(1)).create(refEq(topicSubscriber));
|
||||
assertEquals(subscriberId, new Long(1));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user