Search in sources :

Example 1 with ClusterTemplateTestDto

use of com.sequenceiq.it.cloudbreak.dto.clustertemplate.ClusterTemplateTestDto in project cloudbreak by hortonworks.

the class ClusterTemplateTest method validateDefaultCount.

private ClusterTemplateTestDto validateDefaultCount(TestContext tc, ClusterTemplateTestDto entity, CloudbreakClient cc) {
    try {
        assertNotNull(entity);
        assertNotNull(entity.getResponses());
        long defaultCount = entity.getResponses().stream().filter(template -> ResourceStatus.DEFAULT.equals(template.getStatus())).count();
        long expectedCount = 602;
        assertEquals("Should have " + expectedCount + " of default cluster templates.", expectedCount, defaultCount);
    } catch (Exception e) {
        throw new TestFailException(String.format("Failed to validate default count of cluster templates: %s", e.getMessage()), e);
    }
    return entity;
}
Also used : ClusterTestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTestDto) DistroXTemplateTestDto(com.sequenceiq.it.cloudbreak.dto.clustertemplate.DistroXTemplateTestDto) ResourceStatus(com.sequenceiq.cloudbreak.api.endpoint.v4.common.ResourceStatus) DistroXImageTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.image.DistroXImageTestDto) ClusterTemplateTestDto(com.sequenceiq.it.cloudbreak.dto.clustertemplate.ClusterTemplateTestDto) Test(org.testng.annotations.Test) StringUtils(org.apache.commons.lang3.StringUtils) MockCloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.mock.MockCloudProvider) Description(com.sequenceiq.it.cloudbreak.context.Description) Inject(javax.inject.Inject) DistroXNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXNetworkTestDto) StackTemplateTestDto(com.sequenceiq.it.cloudbreak.dto.stack.StackTemplateTestDto) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) BadRequestException(javax.ws.rs.BadRequestException) MockedTestContext(com.sequenceiq.it.cloudbreak.context.MockedTestContext) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) ClusterTemplateAuditGrpcServiceAssertion(com.sequenceiq.it.cloudbreak.assertion.audit.ClusterTemplateAuditGrpcServiceAssertion) Assert.assertNotNull(org.junit.Assert.assertNotNull) PlacementSettingsTestDto(com.sequenceiq.it.cloudbreak.dto.PlacementSettingsTestDto) DistroXClouderaManagerTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.cluster.clouderamanager.DistroXClouderaManagerTestDto) ClusterTemplateV4Type(com.sequenceiq.cloudbreak.api.endpoint.v4.clustertemplate.ClusterTemplateV4Type) LdapTestClient(com.sequenceiq.it.cloudbreak.client.LdapTestClient) ClusterTemplateTestAssertion(com.sequenceiq.it.cloudbreak.assertion.clustertemplate.ClusterTemplateTestAssertion) NotFoundException(javax.ws.rs.NotFoundException) DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) ClusterTemplateTestClient(com.sequenceiq.it.cloudbreak.client.ClusterTemplateTestClient) EnvironmentTestClient(com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) DistroXTestClient(com.sequenceiq.it.cloudbreak.client.DistroXTestClient) RunningParameter(com.sequenceiq.it.cloudbreak.context.RunningParameter) EnvironmentStatus(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) RecipeTestClient(com.sequenceiq.it.cloudbreak.client.RecipeTestClient) RunningParameter.expectedMessage(com.sequenceiq.it.cloudbreak.context.RunningParameter.expectedMessage) Assert.assertEquals(org.junit.Assert.assertEquals) ImageCatalogTestDto(com.sequenceiq.it.cloudbreak.dto.imagecatalog.ImageCatalogTestDto) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) BadRequestException(javax.ws.rs.BadRequestException) NotFoundException(javax.ws.rs.NotFoundException)

Aggregations

ClusterTemplateV4Type (com.sequenceiq.cloudbreak.api.endpoint.v4.clustertemplate.ClusterTemplateV4Type)1 ResourceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.common.ResourceStatus)1 EnvironmentStatus (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus)1 CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)1 ClusterTemplateAuditGrpcServiceAssertion (com.sequenceiq.it.cloudbreak.assertion.audit.ClusterTemplateAuditGrpcServiceAssertion)1 ClusterTemplateTestAssertion (com.sequenceiq.it.cloudbreak.assertion.clustertemplate.ClusterTemplateTestAssertion)1 ClusterTemplateTestClient (com.sequenceiq.it.cloudbreak.client.ClusterTemplateTestClient)1 DistroXTestClient (com.sequenceiq.it.cloudbreak.client.DistroXTestClient)1 EnvironmentTestClient (com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient)1 LdapTestClient (com.sequenceiq.it.cloudbreak.client.LdapTestClient)1 RecipeTestClient (com.sequenceiq.it.cloudbreak.client.RecipeTestClient)1 MockCloudProvider (com.sequenceiq.it.cloudbreak.cloud.v4.mock.MockCloudProvider)1 Description (com.sequenceiq.it.cloudbreak.context.Description)1 MockedTestContext (com.sequenceiq.it.cloudbreak.context.MockedTestContext)1 RunningParameter (com.sequenceiq.it.cloudbreak.context.RunningParameter)1 RunningParameter.expectedMessage (com.sequenceiq.it.cloudbreak.context.RunningParameter.expectedMessage)1 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)1 ClusterTestDto (com.sequenceiq.it.cloudbreak.dto.ClusterTestDto)1 PlacementSettingsTestDto (com.sequenceiq.it.cloudbreak.dto.PlacementSettingsTestDto)1 ClusterTemplateTestDto (com.sequenceiq.it.cloudbreak.dto.clustertemplate.ClusterTemplateTestDto)1