use of org.onap.aai.domain.yang.Configuration in project so by onap.
the class BBInputSetupUtilsTest method getRelatedConfigurationByNameFromServiceInstanceTest.
@Test
public void getRelatedConfigurationByNameFromServiceInstanceTest() throws Exception {
Configuration configuration = new Configuration();
configuration.setConfigurationId("id123");
doReturn(Optional.of(configuration)).when(MOCK_aaiResourcesClient).getOne(Configurations.class, Configuration.class, AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment("service-instance-id123")).relatedTo(Types.CONFIGURATIONS.getFragment()).queryParam("configuration-name", "configuration-name123"));
Optional<Configuration> actual = this.bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("service-instance-id123", "configuration-name123");
assertTrue(actual.isPresent());
assertEquals(configuration.getConfigurationId(), actual.get().getConfigurationId());
}
use of org.onap.aai.domain.yang.Configuration in project so by onap.
the class BBInputSetupUtilsTest method getAAIConfigurationTest.
@Test
public void getAAIConfigurationTest() throws IOException {
final String configurationId = "configurationId";
Configuration expectedAaiConfiguration = mapper.readValue(new File(RESOURCE_PATH + "ConfigurationInput.json"), Configuration.class);
doReturn(Optional.of(expectedAaiConfiguration)).when(MOCK_aaiResourcesClient).get(isA(Class.class), isA(AAIResourceUri.class));
assertThat(bbInputSetupUtils.getAAIConfiguration(configurationId), sameBeanAs(expectedAaiConfiguration));
}
use of org.onap.aai.domain.yang.Configuration in project so by onap.
the class WorkflowActionBBTasksTest method getConfigurationId.
@Test
public void getConfigurationId() throws Exception {
org.onap.aai.domain.yang.Vnfc vnfc = new org.onap.aai.domain.yang.Vnfc();
vnfc.setModelInvariantId("modelInvariantId");
vnfc.setVnfcName("testVnfcName");
List<Configuration> configurations = new ArrayList<>();
org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration();
configuration.setConfigurationId("configurationId");
configuration.setModelCustomizationId("modelCustimizationId");
configuration.setConfigurationName("testConfigurationName");
configurations.add(configuration);
doReturn(configurations.get(0).getConfigurationId()).when(workflowActionBBTasks).getConfigurationId(vnfc);
assertEquals(workflowActionBBTasks.getConfigurationId(vnfc), "configurationId");
}
use of org.onap.aai.domain.yang.Configuration in project so by onap.
the class WorkflowActionBBTasksTest method setConfigurationNameTest.
@Test
public void setConfigurationNameTest() {
String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
WorkflowType resourceType = WorkflowType.CONFIGURATION;
InfraActiveRequests request = new InfraActiveRequests();
Configuration configuration = new Configuration();
configuration.setConfigurationName("configurationName");
doReturn(configuration).when(bbSetupUtils).getAAIConfiguration(resourceId);
workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
assertEquals("configurationName", request.getConfigurationName());
}
Aggregations