in component-test/src/main/java/org/apache/fineract/cn/provisioner/tenant/TenantApiDocumentation.java [156:215]
public void documentFetchTenants ( ) throws Exception {
final Tenant firstTenant = Fixture.getCompTestTenant();
provisioner.createTenant(firstTenant);
final Tenant secondTenant = Fixture.getCompTestTenant();
provisioner.createTenant(secondTenant);
this.mockMvc.perform(get("/tenants")
.accept(MediaType.APPLICATION_JSON_VALUE)
.contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(status().isOk())
.andDo(document("document-fetch-tenants", preprocessResponse(prettyPrint()),
responseFields(
fieldWithPath("[].identifier").description("Tenant's Identifier"),
fieldWithPath("[].name").description("Tenant's name"),
fieldWithPath("[].description").description("Tenant's description"),
fieldWithPath("[].cassandraConnectionInfo").type("CassandraConnectionInfo").description("Tenant's Cassandra Connection Information +\n" +
" +\n" +
"*class* _CassandraConnectionInfo_ { +\n" +
" String clusterName; +\n" +
" String contactPoints; +\n" +
" String keyspace; +\n" +
" String replicationType; +\n" +
" String replicas; +\n" +
" } +"),
fieldWithPath("[].databaseConnectionInfo").type("_DatabaseConnectionInfo_").description("Tenant's Database Connection Information +\n" +
" +\n" +
"*class* _DatabaseConnectionInfo_ { +\n" +
" String driverClass; +\n" +
" String databaseName; +\n" +
" String host; +\n" +
" String port; +\n" +
" String user; +\n" +
" String password; +\n" +
" } +"),
fieldWithPath("[1].identifier").description("Tenant's Identifier"),
fieldWithPath("[1].name").description("Tenant's name"),
fieldWithPath("[1].description").description("Tenant's description"),
fieldWithPath("[1].cassandraConnectionInfo").type("CassandraConnectionInfo").description("Tenant's Cassandra Connection Information +\n" +
" +\n" +
"*class* _CassandraConnectionInfo_ { +\n" +
" String clusterName; +\n" +
" String contactPoints; +\n" +
" String keyspace; +\n" +
" String replicationType; +\n" +
" String replicas; +\n" +
" } +"),
fieldWithPath("[1].databaseConnectionInfo").type("_DatabaseConnectionInfo_").description("Tenant's Database Connection Information +\n" +
" +\n" +
"*class* _DatabaseConnectionInfo_ { +\n" +
" String driverClass; +\n" +
" String databaseName; +\n" +
" String host; +\n" +
" String port; +\n" +
" String user; +\n" +
" String password; +\n" +
" } +")
)
));
}