Search in sources :

Example 11 with MeteringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration in project cloudbreak by hortonworks.

the class DatabusRequestConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(true, "CdpVmMetrics", "CdpVmMetrics");
    DatabusRequest input = DatabusRequest.Builder.newBuilder().withRawBody("{}").withContext(DatabusRequestContext.Builder.newBuilder().withAccountId("cloudera").addAdditionalDatabusHeader("third-header", "app-name").build()).build();
    // WHEN
    DbusProto.PutRecordRequest result = DatabusRequestConverter.convert(input, meteringConfiguration);
    // THEN
    assertEquals("cloudera", result.getRecord().getAccountId());
    assertEquals("{}", result.getRecord().getBody().getPayload().toStringUtf8());
    assertEquals(3, result.getRecord().getBody().getHeaderCount());
}
Also used : MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) DatabusRequest(com.sequenceiq.cloudbreak.sigmadbus.model.DatabusRequest) DbusProto(com.cloudera.sigma.service.dbus.DbusProto) Test(org.junit.jupiter.api.Test)

Aggregations

MeteringConfiguration (com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration)11 TelemetryConfiguration (com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration)6 ClusterLogsCollectionConfiguration (com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration)6 AltusDatabusConfiguration (com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration)5 DatabusRequest (com.sequenceiq.cloudbreak.sigmadbus.model.DatabusRequest)5 MonitoringConfiguration (com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration)5 Test (org.junit.jupiter.api.Test)5 DbusProto (com.cloudera.sigma.service.dbus.DbusProto)2 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)2 Before (org.junit.Before)2 Test (org.junit.Test)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 AnonymizationRuleResolver (com.sequenceiq.cloudbreak.telemetry.common.AnonymizationRuleResolver)1 AdlsGen2ConfigGenerator (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.AdlsGen2ConfigGenerator)1 GcsConfigGenerator (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.GcsConfigGenerator)1 S3ConfigGenerator (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3ConfigGenerator)1 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)1