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());
}
Aggregations