Search in sources :

Example 1 with PlatformNoSqlTableResponse

use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTableResponse in project cloudbreak by hortonworks.

the class CloudNoSqlTablesToPlatformNoSqlTablesV1ResponseConverterTest method convert.

@Test
void convert() {
    List<CloudNoSqlTable> tables = List.of(new CloudNoSqlTable("a"), new CloudNoSqlTable("b"));
    CloudNoSqlTables source = new CloudNoSqlTables(tables);
    PlatformNoSqlTablesResponse result = underTest.convert(source);
    List<PlatformNoSqlTableResponse> noSqlTables = result.getNoSqlTables();
    assertNotNull(noSqlTables);
    assertEquals(tables.size(), noSqlTables.size());
    tables.forEach(t -> {
        assertTrue(noSqlTables.stream().anyMatch(s -> t.getName().equals(s.getName())));
    });
}
Also used : Test(org.junit.jupiter.api.Test) PlatformNoSqlTableResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTableResponse) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) BeforeEach(org.junit.jupiter.api.BeforeEach) List(java.util.List) CloudNoSqlTable(com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTable) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) PlatformNoSqlTablesResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTablesResponse) CloudNoSqlTables(com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables) CloudNoSqlTables(com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables) CloudNoSqlTable(com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTable) PlatformNoSqlTablesResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTablesResponse) PlatformNoSqlTableResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTableResponse) Test(org.junit.jupiter.api.Test)

Aggregations

CloudNoSqlTable (com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTable)1 CloudNoSqlTables (com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables)1 PlatformNoSqlTableResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTableResponse)1 PlatformNoSqlTablesResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTablesResponse)1 List (java.util.List)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertNotNull (org.junit.jupiter.api.Assertions.assertNotNull)1 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1