use of com.sequenceiq.consumption.api.v1.consumption.model.request.StorageConsumptionRequest in project cloudbreak by hortonworks.
the class ConsumptionApiConverterTest method testInitCreationDtoForStorage.
@Test
void testInitCreationDtoForStorage() {
StorageConsumptionRequest request = new StorageConsumptionRequest();
request.setEnvironmentCrn("env-crn");
request.setMonitoredResourceType(ResourceType.DATALAKE);
request.setMonitoredResourceName("name");
request.setMonitoredResourceCrn("dl-crn");
request.setStorageLocation("location");
ConsumptionCreationDto result = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.initCreationDtoForStorage(request));
Assertions.assertEquals("name_STORAGE", result.getName());
Assertions.assertNull(result.getDescription());
Assertions.assertEquals("test-aws", result.getAccountId());
Assertions.assertTrue(result.getResourceCrn().startsWith("crn:cdp:consumption:us-west-1:test-aws:consumption:"));
Assertions.assertEquals("env-crn", result.getEnvironmentCrn());
Assertions.assertEquals(ResourceType.DATALAKE, result.getMonitoredResourceType());
Assertions.assertEquals("dl-crn", result.getMonitoredResourceCrn());
Assertions.assertEquals(ConsumptionType.STORAGE, result.getConsumptionType());
Assertions.assertEquals("location", result.getStorageLocation());
}
Aggregations