Search in sources :

Example 6 with ServiceProxyResourceCustomization

use of org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization in project so by onap.

the class VrfValidationTest method testVrfCatalogDbChecks.

@Test
public void testVrfCatalogDbChecks() throws VrfBondingServiceException {
    Service service = new Service();
    service.setModelName("modelName");
    ConfigurationResourceCustomization configuration = new ConfigurationResourceCustomization();
    service.setConfigurationCustomizations(new ArrayList<>());
    service.getConfigurationCustomizations().add(configuration);
    ServiceProxyResourceCustomization serviceProxy = new ServiceProxyResourceCustomization();
    configuration.setServiceProxyResourceCustomization(serviceProxy);
    service.setServiceProxyCustomizations(new ArrayList<>());
    service.getServiceProxyCustomizations().add(serviceProxy);
    Service sourceService = new Service();
    sourceService.setServiceType("TRANSPORT");
    serviceProxy.setSourceService(sourceService);
    configuration.setType("VRF-ENTRY");
    configuration.setRole("INFRASTRUCTURE-CLOUD-VPN");
    ExpectedException.none();
    vrfValidation.vrfCatalogDbChecks(service);
}
Also used : ServiceProxyResourceCustomization(org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization) Service(org.onap.so.db.catalog.beans.Service) ConfigurationResourceCustomization(org.onap.so.db.catalog.beans.ConfigurationResourceCustomization) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 7 with ServiceProxyResourceCustomization

use of org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization in project so by onap.

the class BBInputSetupTest method testGetServiceProxy.

@Test
public void testGetServiceProxy() {
    ServiceProxy expected = new ServiceProxy();
    expected.setType("TRANSPORT");
    expected.setModelInfoServiceProxy(new ModelInfoServiceProxy());
    expected.getModelInfoServiceProxy().setModelUuid("modelUUID");
    expected.getModelInfoServiceProxy().setModelInstanceName("modelInstanceName");
    expected.setServiceInstance(new ServiceInstance());
    expected.getServiceInstance().setModelInfoServiceInstance(new ModelInfoServiceInstance());
    expected.getServiceInstance().getModelInfoServiceInstance().setModelUuid("modelUUID");
    expected.getServiceInstance().getModelInfoServiceInstance().setServiceType("TRANSPORT");
    Service service = new Service();
    ServiceProxyResourceCustomization serviceProxyCatalog = new ServiceProxyResourceCustomization();
    serviceProxyCatalog.setModelCustomizationUUID("modelCustomizationUUID");
    serviceProxyCatalog.setModelInstanceName("modelInstanceName");
    Service sourceService = new Service();
    sourceService.setModelUUID("modelUUID");
    sourceService.setServiceType("TRANSPORT");
    serviceProxyCatalog.setSourceService(sourceService);
    service.setServiceProxyCustomizations(new ArrayList<ServiceProxyResourceCustomization>());
    service.getServiceProxyCustomizations().add(serviceProxyCatalog);
    ServiceProxy actual = SPY_bbInputSetup.getServiceProxy(service);
    assertThat(actual, sameBeanAs(expected));
}
Also used : ModelInfoServiceProxy(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy) ServiceProxy(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy) ServiceProxyResourceCustomization(org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Service(org.onap.so.db.catalog.beans.Service) ModelInfoServiceProxy(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Test(org.junit.Test)

Aggregations

ServiceProxyResourceCustomization (org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization)7 Service (org.onap.so.db.catalog.beans.Service)5 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Test (org.junit.Test)2 Metadata (org.onap.sdc.toscaparser.api.elements.Metadata)2 ConfigurationResourceCustomization (org.onap.so.db.catalog.beans.ConfigurationResourceCustomization)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Date (java.util.Date)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Matcher (java.util.regex.Matcher)1