josehernandezfintecheandomx commented on code in PR #2753:
URL: https://github.com/apache/fineract/pull/2753#discussion_r1033519637
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientTest.java:
##########
@@ -263,4 +282,51 @@ public void
testClientAddressCreationWorksAfterClientIsCreated() {
assertThat(addressResponse.getPostalCode()).isEqualTo(postalCode);
}
+ @Test
+ public void createClientWithDatatable() {
+ // creating datatable for client entity person subentity
+ final HashMap<String, Object> columnMap = new HashMap<>();
+ final List<HashMap<String, Object>> datatableColumnsList = new
ArrayList<>();
+ final String datatableName =
Utils.randomNameGenerator(CLIENT_APP_TABLE_NAME + "_",
5).toLowerCase().toLowerCase();
+ columnMap.put("datatableName", datatableName);
+ columnMap.put("apptableName", CLIENT_APP_TABLE_NAME);
+ columnMap.put("entitySubType", "PERSON");
+ columnMap.put("multiRow", false);
+ String itsAString = "itsastring";
+ String dateFormat = "dateFormat";
+
+ DatatableHelper.addDatatableColumns(datatableColumnsList, itsAString,
"String", true, 10, null);
+ columnMap.put("columns", datatableColumnsList);
+ String datatabelRequestJsonString = new Gson().toJson(columnMap);
+ LOG.info("map : {}", datatabelRequestJsonString);
+
+ HashMap<String, Object> datatableResponse =
datatableHelper.createDatatable(datatabelRequestJsonString, "");
+ final String resourceIdentifier = (String)
datatableResponse.get("resourceIdentifier");
+ DatatableHelper.verifyDatatableCreatedOnServer(requestSpec,
responseSpec, resourceIdentifier);
+
+ final PostEntityDatatableChecksTemplateResponse
entityPersonDatatableChecksResponse = entityDatatableChecksHelper
+ .addEntityDatatableCheck(CLIENT_APP_TABLE_NAME, datatableName,
100, null);
+ assertNotNull(entityPersonDatatableChecksResponse);
+ LOG.info("entityDatatableChecksResponse : {}",
entityPersonDatatableChecksResponse.getResourceId());
+
+ final HashMap<String, Object> datatableEntryMap = new HashMap<>();
+ datatableEntryMap.put(itsAString, Utils.randomStringGenerator("", 8));
+ datatableEntryMap.put("locale", "en");
+
+ final HashMap<String, Object> datatablesMap = new HashMap<>();
+ datatablesMap.put("registeredTableName", datatableName);
+ datatablesMap.put("data", datatableEntryMap);
+
+ String datatablesJsonString = new Gson().toJson(datatablesMap);
+ LOG.info("map1 : {}", datatablesJsonString);
+
+ PostClientsResponse postClientsResponse =
ClientHelper.createClientAsPersonWithDatatable(requestSpec, responseSpec, "04
March 2011",
+ "1", datatablesMap);
+ assertNotNull(postClientsResponse);
+
+ postClientsResponse =
ClientHelper.createClientAsPersonWithDatatable(requestSpec, responseSpecErr403,
"04 March 2011", "1", null);
+
+
entityDatatableChecksHelper.deleteEntityDatatableCheck(entityPersonDatatableChecksResponse.getResourceId().intValue());
Review Comment:
Why do I need to validate this? If the change is related to Client creation
with datatable data
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]