Search in sources :

Example 31 with StructuredSyncEvent

use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredSyncEvent in project cloudbreak by hortonworks.

the class StructuredEventToCDPStatusDetailsConverterTest method testConversionFilledOutValues.

@Test
public void testConversionFilledOutValues() {
    StructuredFlowEvent structuredFlowEvent = new StructuredFlowEvent();
    structuredFlowEvent.setStack(createStackDetails());
    structuredFlowEvent.setCluster(createClusterDetails());
    UsageProto.CDPStatusDetails flowStatusDetails = underTest.convert(structuredFlowEvent);
    Assert.assertEquals("AVAILABLE", flowStatusDetails.getStackStatus());
    Assert.assertEquals("AVAILABLE", flowStatusDetails.getStackDetailedStatus());
    Assert.assertEquals("statusreason", flowStatusDetails.getStackStatusReason());
    Assert.assertEquals("AVAILABLE", flowStatusDetails.getClusterStatus());
    Assert.assertEquals("statusreason", flowStatusDetails.getClusterStatusReason());
    StructuredSyncEvent structuredSyncEvent = new StructuredSyncEvent();
    structuredSyncEvent.setStack(createStackDetails());
    structuredSyncEvent.setCluster(createClusterDetails());
    UsageProto.CDPStatusDetails syncStatusDetails = underTest.convert(structuredSyncEvent);
    Assert.assertEquals("AVAILABLE", syncStatusDetails.getStackStatus());
    Assert.assertEquals("AVAILABLE", syncStatusDetails.getStackDetailedStatus());
    Assert.assertEquals("statusreason", syncStatusDetails.getStackStatusReason());
    Assert.assertEquals("AVAILABLE", syncStatusDetails.getClusterStatus());
    Assert.assertEquals("statusreason", syncStatusDetails.getClusterStatusReason());
}
Also used : StructuredSyncEvent(com.sequenceiq.cloudbreak.structuredevent.event.StructuredSyncEvent) StructuredFlowEvent(com.sequenceiq.cloudbreak.structuredevent.event.StructuredFlowEvent) UsageProto(com.cloudera.thunderhead.service.common.usage.UsageProto) Test(org.junit.jupiter.api.Test)

Example 32 with StructuredSyncEvent

use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredSyncEvent in project cloudbreak by hortonworks.

the class StructuredSyncEventToCDPSyncDetailsConverterTest method testConversionWithEmptyStackDetails.

@Test
public void testConversionWithEmptyStackDetails() {
    StructuredSyncEvent structuredSyncEvent = new StructuredSyncEvent();
    StackDetails stackDetails = new StackDetails();
    structuredSyncEvent.setStack(stackDetails);
    UsageProto.CDPSyncDetails details = underTest.convert(structuredSyncEvent);
    Assert.assertEquals("UNKNOWN", details.getDatabaseType());
}
Also used : StructuredSyncEvent(com.sequenceiq.cloudbreak.structuredevent.event.StructuredSyncEvent) StackDetails(com.sequenceiq.cloudbreak.structuredevent.event.StackDetails) UsageProto(com.cloudera.thunderhead.service.common.usage.UsageProto) Test(org.junit.jupiter.api.Test)

Aggregations

StructuredSyncEvent (com.sequenceiq.cloudbreak.structuredevent.event.StructuredSyncEvent)32 Test (org.junit.jupiter.api.Test)30 UsageProto (com.cloudera.thunderhead.service.common.usage.UsageProto)28 StructuredFlowEvent (com.sequenceiq.cloudbreak.structuredevent.event.StructuredFlowEvent)22 StackDetails (com.sequenceiq.cloudbreak.structuredevent.event.StackDetails)10 BlueprintDetails (com.sequenceiq.cloudbreak.structuredevent.event.BlueprintDetails)5 ClusterDetails (com.sequenceiq.cloudbreak.structuredevent.event.ClusterDetails)4 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)3 Json (com.sequenceiq.cloudbreak.common.json.Json)2 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)2 InstanceGroupDetails (com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails)2 OperationDetails (com.sequenceiq.cloudbreak.structuredevent.event.legacy.OperationDetails)2 DetailedStackStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.common.DetailedStackStatus)1 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)1 NotFoundException (com.sequenceiq.cloudbreak.common.exception.NotFoundException)1 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)1 StackStatus (com.sequenceiq.cloudbreak.domain.stack.StackStatus)1 HashMap (java.util.HashMap)1 JobExecutionException (org.quartz.JobExecutionException)1