package org.onap.so.adapters.catalogdb;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
protected int port;
@Test
- public void testNothing() {}
+ public void testNothing() {
+ assertTrue(true);
+ }
@DynamicPropertySource
static void configureProperties(DynamicPropertyRegistry registry) {
HeatTemplate moduleHeatTemplate = new HeatTemplate();
moduleHeatTemplate.setArtifactChecksum("artifactChecksum");
moduleHeatTemplate.setArtifactUuid("artifactUuid");
- List<HeatTemplate> childTemplates;
// moduleHeatTemplate.setChildTemplates(childTemplates);
moduleHeatTemplate.setDescription("description");
Set<HeatTemplateParam> parameters = new HashSet<>();
logger.debug("orchestrating a VNF - *NOT* a module!");
requestTypeString = requestTypeString.substring(1);
}
-
// let's parse out the request type we're being sent
- boolean isBaseRequest = false;
boolean isVolumeRequest = false;
if (requestTypeString.startsWith("VOLUME")) {
isVolumeRequest = true;
logger.trace("Found vfModuleCust entry {}", vfmc.toString());
}
if (vf.getIsBase()) {
- isBaseRequest = true;
logger.debug("This is a BASE VF request!");
} else {
logger.debug("This is *not* a BASE VF request!");
* ================================================================================ Licensed under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy
* of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
package org.onap.so.adapters.vnf;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class VfRollbackTest {
@Test
public void testtoString() {
- assert (vfRollback.toString() != null);
+ assertNotNull(vfRollback.toString());
}
}
when(port.getMacAddress()).thenReturn("78:4f:43:68:e2:78");
when(port.getNetworkId()).thenReturn("890a203a-23gg-56jh-df67-731656a8f13a");
when(port.getDeviceId()).thenReturn("test-device-id");
- String pfPciId = "0000:08:00.0";
Network network = mock(Network.class);
when(network.getId()).thenReturn("test-network-id");
when(port.getMacAddress()).thenReturn("78:4f:43:68:e2:78");
when(port.getNetworkId()).thenReturn("890a203a-23gg-56jh-df67-731656a8f13a");
when(port.getDeviceId()).thenReturn(null);
- String pfPciId = "0000:08:00.0";
Network network = mock(Network.class);
when(network.getId()).thenReturn("test-network-id");
@Autowired
private RestTemplate restTemplate;
- @Autowired
- private Environment env;
-
private static final ObjectMapper objMapper = new ObjectMapper();
public SDNCService() {
public Status runCommand(Action action, org.onap.appc.client.lcm.model.ActionIdentifiers actionIdentifiers,
org.onap.appc.client.lcm.model.Payload payload, String requestID, ApplicationControllerCallback listener,
String requestorId) throws ApplicationControllerOrchestratorException {
- Status status;
Object requestObject;
requestObject = createRequest(action, actionIdentifiers, payload, requestID, requestorId);
appCSupport.logLCMMessage(requestObject);
private static final Logger logger = LoggerFactory.getLogger(ApplicationControllerTask.class);
- @Autowired
- public Environment env;
-
@Autowired
public ApplicationControllerTaskImpl applicationControllerTaskImpl;
String errorMessage = "errormessage";
AppcClientException exception = new AppcClientException(errorMessage);
Status status = applicationControllerSupport.buildStatusFromAppcException(exception);
- assertThat(status.getCode() == 200);
- assertThat((status.getMessage()).equals(("Exception on APPC request: " + errorMessage)));
+ assertThat(status.getCode()).isEqualTo(200);
+ assertThat(status.getMessage()).isEqualTo("Exception on APPC request: " + errorMessage);
}
private Status createStatus(int code) {
requestAction, lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
doReturn(service).when(SPY_bbInputSetupUtils)
.getCatalogServiceByModelUUID(gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid());
- String generatedId = "12131";
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
}
@Test
public void TestGenerateVfModuleNameSuvvess() {
- //
- String request =
- "<vnf-request xmlns=\"http://ecomp.att.com/mso/infra/vnf-request/v1\">" + EOL + " <request-info>" + EOL
- + " <action>CREATE_VF_MODULE</action>" + EOL + " <source>PORTAL</source>" + EOL
- + " </request-info>" + EOL + " <vnf-inputs>" + EOL + " <vnf-name>STMTN5MMSC22</vnf-name>"
- + EOL + " <vf-module-name>STMTN5MMSC22-MMSC::module-0-0</vf-module-name>" + EOL
- + " <vf-module-model-name>MMSC::module-0</vf-module-model-name>" + EOL
- + " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL
- + " <persona-model-version>1.0</persona-model-version>" + EOL
- + " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL
- + " <aic-node-clli>MDTWNJ21</aic-node-clli>" + EOL
- + " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL + " </vnf-inputs>" + EOL
- + " <vnf-params xmlns:tns=\"http://ecomp.att.com/mso/infra/vnf-request/v1\"/>" + EOL
- + "</vnf-request>" + EOL;
+ //
MockGetGenericVnfById(wireMockServer, ".*", "GenericFlows/getGenericVnfByNameResponse.xml");
RuntimeService runtimeService = processEngine.getRuntimeService();
Map<String, Object> variables = new HashMap<String, Object>();
// SliceProfile
List<org.onap.so.moi.SliceProfile> sliceProfileList = new ArrayList<org.onap.so.moi.SliceProfile>();
- ServiceInstance serviceInstanceObj;
List<Relationship> listOfNssiRelationship = serviceInstance.getRelationshipList().getRelationship();
List<Relationship> listOfNssiRelationshipAR = listOfNssiRelationship.stream()
String environmentContext = null;
String serviceType = null;
String operationalState = "LOCKED";
- String orchistrationStatus = "Assigned";
for (org.onap.so.moi.SliceProfile moiSliceProfile : moiRequestAttributes.getSliceProfileList()) {
serviceInstanceLocationId = getPlmnId(moiSliceProfile.getPlmnInfoList().get(0).getPlmnId());
execution.setVariable("vserverIdList", null);
execution.setVariable("vmIndex", 0);
execution.setVariable("vmIdListSize", 0);
-
- String vfModuleId = null;
VfModule vfModule = null;
try {
vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
} catch (BBObjectNotFoundException e) {
}
if (vfModule != null) {
- vfModuleId = vfModule.getVfModuleId();
}
if (action.equals(Action.Snapshot)) {
try {
@Test
public void selectExecutionListMacroResumeTest() throws Exception {
String gAction = "createInstance";
- String resource = "Service";
String bpmnRequest = readBpmnRequestFromFile(MACRO_ASSIGN_JSON);
initExecution(gAction, bpmnRequest, false);
execution.setVariable("requestUri", "v6/serviceInstances/123");
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so</groupId>
- <artifactId>common</artifactId>
- <version>1.16.0-SNAPSHOT</version>
- </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>1.16.0-SNAPSHOT</version>
+ </parent>
- <groupId>org.onap.so.common</groupId>
- <artifactId>clients</artifactId>
+ <groupId>org.onap.so.common</groupId>
+ <artifactId>clients</artifactId>
- <properties>
- <ccsdk.version>1.1.5</ccsdk.version>
- <protobuf.version>3.22.2</protobuf.version>
- <grpc.netty.version>4.1.30.Final</grpc.netty.version>
- </properties>
+ <properties>
+ <ccsdk.version>1.1.5</ccsdk.version>
+ <protobuf.version>3.22.2</protobuf.version>
+ <grpc.netty.version>4.1.30.Final</grpc.netty.version>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.onap.so</groupId>
- <artifactId>utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.so</groupId>
- <artifactId>clients-base</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.inject</groupId>
- <artifactId>jersey-hk2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
- <artifactId>blueprint-proto</artifactId>
- <version>${ccsdk.version}</version>
- <exclusions>
- <exclusion>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-boot-starter</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${protobuf.version}</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-protobuf</artifactId>
- <version>${grpc.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty</artifactId>
- <version>${grpc.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- <version>${kafka-clients.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.webcompere</groupId>
- <artifactId>system-stubs-jupiter</artifactId>
- <version>1.1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-testing</artifactId>
- <version>${grpc.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>clients-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
+ <version>${ccsdk.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-boot-starter</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-protobuf</artifactId>
+ <version>${grpc.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ <version>${kafka-clients.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.webcompere</groupId>
+ <artifactId>system-stubs-jupiter</artifactId>
+ <version>1.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-testing</artifactId>
+ <version>${grpc.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so</groupId>
- <artifactId>common</artifactId>
- <version>1.16.0-SNAPSHOT</version>
- </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>1.16.0-SNAPSHOT</version>
+ </parent>
- <artifactId>utils</artifactId>
+ <artifactId>utils</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.onap.so</groupId>
- <artifactId>logger</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.5.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-core</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-external-task-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>logger</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ <version>2.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-external-task-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
private static final Logger logger = LoggerFactory.getLogger(ExternalTaskUtils.class);
@Autowired
- Environment env;
+ protected Environment env;
private final RetrySequenceLevel retrySequenceLevel;
import org.onap.aai.annotations.Metadata;
import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectName;
import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectType;
-import org.onap.aaiclient.client.aai.entities.uri.AAIFluentTypeReverseLookup;
import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
+import org.onap.aaiclient.client.aai.entities.uri.AAIFluentTypeReverseLookup;
import com.google.common.base.CaseFormat;
/**
java.util.Collection<URL> packages = ClasspathHelper.forPackage("");
Reflections r =
new Reflections(new ConfigurationBuilder().setUrls(packages).setScanners(new SubTypesScanner()));
-
Set<Class<? extends AAIObjectType>> resources = r.getSubTypesOf(AAIObjectType.class);
-
for (Class<? extends AAIObjectType> customTypeClass : resources) {
AAIObjectType customType;
try {
InfraActiveRequests aq = new InfraActiveRequests();
try {
String serviceInstanceName = null;
- String serviceInstanceId = null;
if (action.name().equals("ranSlice")) {
serviceInstanceName = "ran_nssi_" + requestId;
aq.setServiceInstanceName(serviceInstanceName);
HttpEntity<String> entity = new HttpEntity<String>(requestJSON, headers);
UriComponentsBuilder builder;
- ResponseEntity<String> response;
- Request request;
-
- // Test valid status
- request = ORCHESTRATION_LIST.getRequestList().get(1).getRequest();
builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(
"/onap/so/infra/orchestrationRequests/v7/" + "5ffbabd6-b793-4377-a1ab-082670fbc7ac" + "/unlock"));
-
- response = restTemplate.exchange(builder.toUriString(), HttpMethod.POST, entity, String.class);
// Cannot assert anything further here, already have a wiremock in place
// which ensures that the post was
// properly called to update.