}
@EventListener(ApplicationReadyEvent.class)
- public void onApplicationReadyEvent() throws Exception {
+ public void onApplicationReadyEvent() {
if (!environment.acceptsProfiles(Profiles.of(TEST_PROFILE))) {
final List<EsrSystemInfo> infos = startupService.receiveVnfm();
subscriptionScheduler.setInfos(infos);
import org.onap.aai.domain.yang.EsrSystemInfo;
import org.onap.so.adapters.vevnfm.aai.AaiConnection;
import org.onap.so.adapters.vevnfm.configuration.ConfigProperties;
-import org.onap.so.adapters.vevnfm.exception.VeVnfmException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.retry.annotation.Backoff;
}
@Retryable(value = {Exception.class}, maxAttempts = 5, backoff = @Backoff(delay = 5000, multiplier = 2))
- public List<EsrSystemInfo> receiveVnfm() throws VeVnfmException {
+ public List<EsrSystemInfo> receiveVnfm() {
return aaiConnection.receiveVnfm();
}
this.restProvider = restProvider;
}
- public String send(final EsrSystemInfo info, final LccnSubscriptionRequest request) throws VeVnfmException {
+ public String send(final EsrSystemInfo info, final LccnSubscriptionRequest request) {
final ResponseEntity<SubscribeToManoResponse> response =
restProvider.postHttpRequest(request, getUrl(info), SubscribeToManoResponse.class);
return esrIds != null && !esrIds.isEmpty();
}
- private void singleSubscribe(final EsrId esrId) throws VeVnfmException {
+ private void singleSubscribe(final EsrId esrId) {
if (esrId.getId() == null) {
logger.info("Single subscribe task");
esrId.setId(subscriberService.subscribe(esrId.getInfo()));
}
}
- private void singleCheckSubscription(final EsrId esrId) throws VeVnfmException {
+ private void singleCheckSubscription(final EsrId esrId) {
if (esrId.getId() != null) {
logger.info("Checking subscription: {}", esrId.getId());
if (!subscriberService.checkSubscription(esrId.getInfo(), esrId.getId())) {
}
@Test
- public void testReceiveNotification() throws Exception {
+ public void testReceiveNotification() {
// given
final MockHttpServletRequestBuilder request =
MockMvcRequestBuilders.post(notification).contentType(MediaType.APPLICATION_JSON).content(JSON);
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest;
import org.onap.so.adapters.vevnfm.configuration.ConfigProperties;
import org.onap.so.adapters.vevnfm.configuration.StartupConfiguration;
-import org.onap.so.adapters.vevnfm.exception.VeVnfmException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpMethod;
}
@Test
- public void testSuccess() throws VeVnfmException {
+ public void testSuccess() {
// given
final EsrSystemInfo info = new EsrSystemInfo();
info.setServiceUrl(URL);
}
}
- public Image queryImage(String cloudSiteId, String tenantId, String imageId)
- throws MsoCloudSiteNotFound, GlanceClientException {
+ public Image queryImage(String cloudSiteId, String tenantId, String imageId) throws GlanceClientException {
try {
Glance glanceClient = getGlanceClient(cloudSiteId, tenantId);
// list is set to false, otherwise an invalid URL is appended
}
public Stacks queryStacks(String cloudSiteId, String tenantId, int limit, String marker)
- throws MsoCloudSiteNotFound, HeatClientException {
+ throws HeatClientException {
Heat heatClient;
try {
heatClient = getHeatClient(cloudSiteId, tenantId);
.withHeader("Content-Type", "application/json").withBodyFile(filename).withStatus(HttpStatus.SC_OK)));
}
- public static void mockOpenStackPostTenantWithBodyFile_200(WireMockServer wireMockServer) throws IOException {
+ public static void mockOpenStackPostTenantWithBodyFile_200(WireMockServer wireMockServer) {
wireMockServer.stubFor(post(urlPathEqualTo("/mockPublicUrl/tenants"))
.willReturn(aResponse().withBodyFile("OpenstackResponse_Tenant.json").withStatus(HttpStatus.SC_OK)));
}
- public static void mockOpenStackGetTenantByName(WireMockServer wireMockServer, String tenantName)
- throws IOException {
+ public static void mockOpenStackGetTenantByName(WireMockServer wireMockServer, String tenantName) {
wireMockServer.stubFor(get(urlMatching("/mockPublicUrl/tenants/[?]name=" + tenantName))
.willReturn(aResponse().withBodyFile("OpenstackResponse_Tenant.json").withStatus(HttpStatus.SC_OK)));
}
- public static void mockOpenStackGetTenantById(WireMockServer wireMockServer, String tenantId) throws IOException {
+ public static void mockOpenStackGetTenantById(WireMockServer wireMockServer, String tenantId) {
wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/tenants/tenantId"))
.willReturn(aResponse().withBodyFile("OpenstackResponse_Tenant.json").withStatus(HttpStatus.SC_OK)));
}
import org.onap.so.db.catalog.beans.AuthenticationType;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.utils.CryptoUtils;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.woorea.openstack.keystone.model.Authentication;
}
@Test
- public void getAuthenticationForV3Test() throws JsonParseException, JsonMappingException, IOException {
+ public void getAuthenticationForV3Test() throws JsonMappingException, IOException {
CloudIdentity identity = new CloudIdentity();
identity.setMsoId("my-username");
import org.onap.so.openstack.exceptions.MsoOpenstackException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.woorea.openstack.base.client.OpenStackBaseException;
import com.woorea.openstack.base.client.OpenStackConnectException;
}
@Test
- public final void testKeystoneErrorToMsoException() throws JsonParseException, JsonMappingException, IOException {
+ public final void testKeystoneErrorToMsoException() throws IOException {
OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
OpenStackBaseException openStackResponseException = new OpenStackResponseException("response", 1);
}
@Test
- public final void testHeatExceptionToMsoException() throws JsonParseException, JsonMappingException, IOException {
+ public final void testHeatExceptionToMsoException() throws IOException {
OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
OpenStackBaseException openStackResponseException = new OpenStackResponseException("response", 1);
}
@Test
- public final void testNeutronExceptionToMsoException()
- throws JsonParseException, JsonMappingException, IOException {
+ public final void testNeutronExceptionToMsoException() throws IOException {
OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
OpenStackBaseException openStackResponseException = new OpenStackResponseException("response", 1);
import org.junit.Test;
import org.onap.so.TestDataSetup;
import org.onap.so.db.catalog.beans.HeatTemplateParam;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
public class MsoHeatEnvironmentEntryTest extends TestDataSetup {
}
@Test
- public void toFullString_ResourceRegistryNotPresentInRawEntry()
- throws JsonParseException, JsonMappingException, IOException {
+ public void toFullString_ResourceRegistryNotPresentInRawEntry() throws IOException {
StringBuilder sb = new StringBuilder(RAW_ENTRY_WITH_NO_RESOURCE_REGISTRY);
MsoHeatEnvironmentEntry testedObject = new MsoHeatEnvironmentEntry(sb);
}
@Test(expected = MsoOpenstackException.class)
- public final void getHeatClientOpenStackResponseException404Test() throws MsoException, IOException {
+ public final void getHeatClientOpenStackResponseException404Test() throws MsoException {
CloudSite cloudSite = getCloudSite(getCloudIdentity());
// mo mocks setup will cause 404 response from wiremock
heatUtils.getHeatClient("MTN13", "TEST-tenant");
}
@Test(expected = MsoOpenstackException.class)
- public final void getHeatClientOpenStackConnectExceptionTest() throws MsoException, IOException {
+ public final void getHeatClientOpenStackConnectExceptionTest() throws MsoException {
CloudIdentity identity = getCloudIdentity();
identity.setIdentityUrl("http://unreachable");
CloudSite cloudSite = getCloudSite(identity);
}
@Test
- public final void pollStackForStatus_Create_Complete_Test() throws MsoException, IOException {
+ public final void pollStackForStatus_Create_Complete_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void pollStackForStatus_No_Polling_Test() throws MsoException, IOException {
+ public final void pollStackForStatus_No_Polling_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void pollStackForStatus_Polling_Exhausted_Test() throws MsoException, IOException {
+ public final void pollStackForStatus_Polling_Exhausted_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void postProcessStackCreate_CREATE_IN_PROGRESS_Test() throws MsoException, IOException {
+ public final void postProcessStackCreate_CREATE_IN_PROGRESS_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void postProcessStackCreate_Backout_True_Test() throws MsoException, IOException {
+ public final void postProcessStackCreate_Backout_True_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void postProcessStackCreate_Backout_True_Delete_Fail_Test() throws MsoException, IOException {
+ public final void postProcessStackCreate_Backout_True_Delete_Fail_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void postProcessStackCreate_Keypair_True_Test() throws MsoException, IOException {
+ public final void postProcessStackCreate_Keypair_True_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void handleUnknownCreateStackFailure_Test() throws MsoException, IOException {
+ public final void handleUnknownCreateStackFailure_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
@Test
- public final void handleUnknownCreateStackFailure_Null_Stack_Test() throws MsoException, IOException {
+ public final void handleUnknownCreateStackFailure_Null_Stack_Test() throws MsoException {
Stack stack = null;
exceptionRule.expect(StackCreationException.class);
exceptionRule.expectMessage("Cannot Find Stack Name or Id");
}
@Test
- public final void postProcessStackDelete_Stack_Test() throws MsoException, IOException {
+ public final void postProcessStackDelete_Stack_Test() throws MsoException {
Stack deletedStack = new Stack();
deletedStack.setId("id");
deletedStack.setStackName("stackName");
}
@Test
- public final void postProcessStackDelete__Null_Stack_Test() throws MsoException, IOException {
+ public final void postProcessStackDelete__Null_Stack_Test() throws MsoException {
Stack stack = null;
exceptionRule.expect(StackRollbackException.class);
exceptionRule.expectMessage("Cannot Find Stack Name or Id");
}
@Test
- public final void isKeyPairFailure_Test() throws MsoException, IOException {
+ public final void isKeyPairFailure_Test() {
boolean actual = heatUtils.isKeyPairFailure(
"Exception during create VF 0 : Stack error (CREATE_FAILED): Resource CREATE failed: Conflict: resources.bfnm_my_keypair: Key pair 'hst3bbfnm0011vm001' already exists. (HTTP 409) (Request-ID:req-941b0af6-63ae-4d6a-afbc-90b728bacf82) - stack successfully deleted'rolledBack='true'");
assertEquals(true, actual);
}
@Test
- public final void handleKeyPairConflict_Test() throws MsoException, IOException, NovaClientException {
+ public final void handleKeyPairConflict_Test() throws MsoException, NovaClientException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void processCreateStack_Test() throws MsoException, IOException, NovaClientException {
+ public final void processCreateStack_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
}
@Test
- public final void processCreateStack_Exception_Backout_Test()
- throws MsoException, IOException, NovaClientException {
+ public final void processCreateStack_Exception_Backout_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
@Test
- public final void createStack_Test() throws MsoException, IOException, NovaClientException {
+ public final void createStack_Test() throws MsoException {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
}
@Test
- public final void saveStack_Test() throws MsoException, IOException, NovaClientException {
+ public final void saveStack_Test() throws IOException {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
}
@Test
- public final void saveStack__Exists_Test() throws MsoException, IOException, NovaClientException {
+ public final void saveStack__Exists_Test() {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
Map<String, Object> parameters = new HashMap<String, Object>();
}
@Test
- public final void createStack_Error_Test() throws MsoException, IOException, NovaClientException {
+ public final void createStack_Error_Test() throws MsoException {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
}
@Test
- public final void createStack_Error_404_Test() throws MsoException, IOException, NovaClientException {
+ public final void createStack_Error_404_Test() throws MsoException {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
}
@Test
- public final void processCreateStack_Exception_No_Backout_Test()
- throws MsoException, IOException, NovaClientException {
+ public final void processCreateStack_Exception_No_Backout_Test() throws MsoException {
Stack stack = new Stack();
stack.setId("id");
stack.setStackName("stackName");
import org.onap.so.db.catalog.beans.HeatTemplate;
import org.onap.so.db.catalog.beans.HeatTemplateParam;
import org.skyscreamer.jsonassert.JSONAssert;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void convertInputMapTest() throws JsonParseException, JsonMappingException, IOException {
+ public void convertInputMapTest() throws JsonMappingException, IOException {
MsoHeatUtils utils = new MsoHeatUtils();
Map<String, Object> input = new HashMap<>();
import org.onap.so.openstack.beans.StackInfo;
import org.onap.so.openstack.exceptions.MsoException;
import org.springframework.core.env.Environment;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.heat.Heat;
import com.woorea.openstack.heat.model.Stack;
}
@Test
- public void updateStackTest() throws MsoException, JsonParseException, JsonMappingException, IOException {
+ public void updateStackTest() throws MsoException, IOException {
CloudSite cloudSite = new CloudSite();
Heat heatClient = new Heat("endpoint");
Stack heatStack = mapper.readValue(new File(RESOURCE_PATH + "HeatStack.json"), Stack.class);
}
@Test
- public void updateStackWithEnvironmentTest()
- throws JsonParseException, JsonMappingException, IOException, MsoException {
+ public void updateStackWithEnvironmentTest() throws IOException, MsoException {
String environmentString = "environmentString";
CloudSite cloudSite = new CloudSite();
}
@Test
- public void updateStackWithFilesTest() throws MsoException, JsonParseException, JsonMappingException, IOException {
+ public void updateStackWithFilesTest() throws MsoException, IOException {
String environmentString = "environmentString";
Map<String, Object> files = new HashMap<>();
files.put("file1", new Object());
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;
import static org.onap.so.openstack.utils.MsoMulticloudUtils.MULTICLOUD_QUERY_BODY_NULL;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Optional;
import org.apache.http.HttpStatus;
"/api/multicloud/v1/CloudOwner/MTN14/infra_workload/TEST-workload";
@Test
- public void createStackSuccess() throws MsoException, IOException {
+ public void createStackSuccess() throws MsoException {
wireMockServer
.stubFor(post(urlEqualTo(MULTICLOUD_CREATE_PATH)).inScenario("CREATE")
.willReturn(aResponse().withHeader("Content-Type", "application/json")
import org.junit.Test;
import org.onap.so.TestDataSetup;
import org.onap.so.db.catalog.beans.HeatTemplateParam;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
public class MsoYamlEditorWithEnvtTest extends TestDataSetup {
private MsoYamlEditorWithEnvt yaml;
"parameters: {" + PARAMETER_NAME + ": " + PARAMETER_VALUE + "}";
@Test
- public void getParameterListTest() throws JsonParseException, JsonMappingException, IOException {
+ public void getParameterListTest() throws IOException {
yaml = new MsoYamlEditorWithEnvt(RAW_ENTRY_WITH_NO_RESOURCE_REGISTRY.getBytes());
MsoHeatEnvironmentParameter expectedHeatParam = mapper.readValue(
}
@Test
- public void getParameterListFromEnvtTest() throws JsonParseException, JsonMappingException, IOException {
+ public void getParameterListFromEnvtTest() throws IOException {
yaml = new MsoYamlEditorWithEnvt(RAW_ENTRY_WITH_NO_RESOURCE_REGISTRY.getBytes());
HeatTemplateParam expectedHeatParam =
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
-import java.io.IOException;
import java.util.UUID;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.openstack.exceptions.MsoException;
import com.woorea.openstack.heat.model.Stack;
@RunWith(MockitoJUnitRunner.class)
}
@Test
- public final void recordExists_Test() throws MsoException, IOException {
+ public final void recordExists_Test() {
RequestProcessingData requestProcessingData = new RequestProcessingData();
requestProcessingData.setValue("testMe");
}
@Test
- public final void record_Not_Exists_Test() throws MsoException, IOException {
+ public final void record_Not_Exists_Test() {
String requestId = getRequestId();
ArgumentCaptor<RequestProcessingData> requestCaptor = ArgumentCaptor.forClass(RequestProcessingData.class);
doReturn(null).when(requestDBClient).getRequestProcessingDataBySoRequestIdAndNameAndGrouping(requestId,
}
@Test
- public void xmlMarshalTest() throws IOException, JAXBException {
+ public void xmlMarshalTest() throws IOException {
CreateVfModuleRequest request = new CreateVfModuleRequest();
request.getVfModuleParams().put("test-null", null);
import org.junit.Test;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.StackInfo;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.woorea.openstack.heat.model.Stack;
}
@Test
- public void checkOutputToMap() throws JsonParseException, JsonMappingException, IOException {
+ public void checkOutputToMap() throws JsonMappingException, IOException {
ObjectMapper jacksonMapper = new ObjectMapper();
Stack sample = jacksonMapper.readValue(this.getJson("stack-example.json"), Stack.class);
StackInfoMapper mapper = new StackInfoMapper(sample);
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
-import org.json.simple.parser.ParseException;
import org.junit.Test;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
import org.onap.so.db.catalog.beans.ProcessingFlags;
/* Service Resources Endpoint */
@Test
- public void testGetServiceModelUUID() throws JSONException, IOException, ParseException {
+ public void testGetServiceModelUUID() throws JSONException, IOException {
HttpEntity<String> entity = new HttpEntity<String>(null, headers);
headers.set("Accept", MediaType.APPLICATION_JSON);
}
@Test
- public void testGetServiceInvariantUUIDAndVersion() throws JSONException, IOException {
+ public void testGetServiceInvariantUUIDAndVersion() throws JSONException {
HttpEntity<String> entity = new HttpEntity<String>(null, headers);
headers.set("Accept", MediaType.APPLICATION_JSON);
UriComponentsBuilder builder =
}
@Test
- public void testGetVFModulesBadQueryParam() throws JSONException, IOException {
+ public void testGetVFModulesBadQueryParam() throws JSONException {
TestAppender.events.clear();
HttpEntity<String> entity = new HttpEntity<String>(null, headers);
headers.set("Accept", MediaType.APPLICATION_JSON);
}
@Test
- public void testGetCloudSiteHappyPath() throws Exception {
+ public void testGetCloudSiteHappyPath() {
CloudSite cloudSite = client.getCloudSite(MTN13);
assertNotNull(cloudSite);
assertNotNull(cloudSite.getIdentityService());
}
@Test
- public void testGetCloudSiteNotFound() throws Exception {
+ public void testGetCloudSiteNotFound() {
CloudSite cloudSite = client.getCloudSite(UUID.randomUUID().toString());
assertNull(cloudSite);
}
@Test
- public void testGetCloudifyManagerHappyPath() throws Exception {
+ public void testGetCloudifyManagerHappyPath() {
CloudifyManager cloudifyManager = client.getCloudifyManager("mtn13");
assertNotNull(cloudifyManager);
assertEquals("http://localhost:28090/v2.0", cloudifyManager.getCloudifyUrl());
}
@Test
- public void testGetCloudifyManagerNotFound() throws Exception {
+ public void testGetCloudifyManagerNotFound() {
CloudifyManager cloudifyManager = client.getCloudifyManager(UUID.randomUUID().toString());
assertNull(cloudifyManager);
}
@Test
- public void testGetCloudSiteByClliAndAicVersionHappyPath() throws Exception {
+ public void testGetCloudSiteByClliAndAicVersionHappyPath() {
CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "2.5");
assertNotNull(cloudSite);
}
@Test
- public void testGetCloudSiteByClliAndAicVersionNotFound() throws Exception {
+ public void testGetCloudSiteByClliAndAicVersionNotFound() {
CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "232496239746328");
assertNull(cloudSite);
}
@Test
- public void testGetServiceByID() throws Exception {
+ public void testGetServiceByID() {
Service serviceByID = client.getServiceByID("5df8b6de-2083-11e7-93ae-92361f002671");
assertNotNull(serviceByID);
assertEquals("MSOTADevInfra_vSAMP10a_Service", serviceByID.getModelName());
}
@Test
- public void testGetServiceByIDNotFound() throws Exception {
+ public void testGetServiceByIDNotFound() {
Service serviceByID = client.getServiceByID(UUID.randomUUID().toString());
assertNull(serviceByID);
}
@Test
- public void testGetVfModuleByModelUUID() throws Exception {
+ public void testGetVfModuleByModelUUID() {
VfModule vfModule = client.getVfModuleByModelUUID("20c4431c-246d-11e7-93ae-92361f002671");
assertNotNull(vfModule);
assertNotNull(vfModule.getVfModuleCustomization());
}
@Test
- public void testGetVfModuleByModelUUIDNotFound() throws Exception {
+ public void testGetVfModuleByModelUUIDNotFound() {
VfModule vfModule = client.getVfModuleByModelUUID(UUID.randomUUID().toString());
assertNull(vfModule);
}
@Test
- public void testGetVnfResourceByModelUUID() throws Exception {
+ public void testGetVnfResourceByModelUUID() {
VnfResource vnfResource = client.getVnfResourceByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
assertNotNull(vnfResource);
assertEquals("vSAMP10a", vnfResource.getModelName());
}
@Test
- public void testGetVnfResourceByModelUUIDNotFound() throws Exception {
+ public void testGetVnfResourceByModelUUIDNotFound() {
VnfResource vnfResource = client.getVnfResourceByModelUUID(UUID.randomUUID().toString());
assertNull(vnfResource);
}
}
@Test
- public void testGetServiceTopologyById() throws Exception {
+ public void testGetServiceTopologyById() {
org.onap.so.rest.catalog.beans.Service serviceByID =
client.getServiceModelInformation("5df8b6de-2083-11e7-93ae-92361f002671", "2");
assertNotNull(serviceByID);
}
@Test
- public void testGetServices() throws Exception {
+ public void testGetServices() {
List<org.onap.so.rest.catalog.beans.Service> services = client.getServices();
assertEquals(false, services.isEmpty());
}
@Test
- public void testVnf() throws Exception {
+ public void testVnf() {
org.onap.so.rest.catalog.beans.Vnf vnf = client.getVnfModelInformation("5df8b6de-2083-11e7-93ae-92361f002671",
"68dc9a92-214c-11e7-93ae-92361f002671", "0");
assertNotNull(vnf);
}
if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && os3template) {
- try {
- mergeRouteTableRefs(routeTableFqdns, stackParams);
- } catch (MsoException me) {
- me.addContext(CREATE_NETWORK_CONTEXT);
- logger.error("{} {} Exception Create Network, merging routeTableRefs type {} in {}/{} ",
- MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(),
- neutronNetworkType.toString(), cloudSiteId, tenantId, me);
- throw new NetworkException(me);
- }
+ mergeRouteTableRefs(routeTableFqdns, stackParams);
}
// Deploy the network stack
}
if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && os3template) {
- try {
- mergeRouteTableRefs(routeTableFqdns, stackParams);
- } catch (MsoException me) {
- me.addContext(UPDATE_NETWORK_CONTEXT);
- logger.error("{} {} Exception - UpdateNetwork mergeRouteTableRefs type {} in {}/{} ",
- MessageEnum.RA_UPDATE_NETWORK_ERR, ErrorCode.DataError.getValue(),
- neutronNetworkType.toString(), cloudSiteId, tenantId, me);
- throw new NetworkException(me);
- }
+ mergeRouteTableRefs(routeTableFqdns, stackParams);
}
// Update the network stack
return;
}
- private void mergeRouteTableRefs(List<String> rtFqdns, Map<String, Object> stackParams) throws MsoException {
+ private void mergeRouteTableRefs(List<String> rtFqdns, Map<String, Object> stackParams) {
// update parameters
if (rtFqdns != null) {
return input;
}
- public static void mockUpdateRequestDb(WireMockServer wireMockServer, String requestId) throws IOException {
+ public static void mockUpdateRequestDb(WireMockServer wireMockServer, String requestId) {
wireMockServer.stubFor(patch(urlPathEqualTo("/infraActiveRequests/" + requestId))
.willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK)));
}
import org.onap.so.audit.beans.AuditInventory;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
import org.onap.so.objects.audit.AAIObjectAuditList;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class CreateAAIInventoryTest extends CreateAAIInventory {
AAIObjectAuditList missingSubInterfaces;
@Before
- public void setup() throws JsonParseException, JsonMappingException, IOException {
+ public void setup() throws IOException {
auditInventory.setCloudOwner("cloudOwner");
auditInventory.setCloudRegion("cloudRegion");
auditInventory.setTenantId("tenantId");
}
@Test
- public void testExecuteExternalTask_InventoryException() throws InventoryException, JsonProcessingException {
+ public void testExecuteExternalTask_InventoryException() throws JsonProcessingException {
AAIObjectAuditList object = new AAIObjectAuditList();
AAIObjectAudit e = new AAIObjectAudit();
e.setDoesObjectExist(true);
import org.onap.so.adapters.vnf.VnfAdapterUtils;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.utils.MsoHeatUtils;
import com.woorea.openstack.heat.model.Stack;
}
@Test
- public void testExecuteExternalTask() throws VnfException, MsoException, IOException {
+ public void testExecuteExternalTask() throws VnfException, IOException {
String payload = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "/vnfAdapterTaskRequestCreate.xml")));
Stack stack = new Stack();
import org.onap.so.adapters.vnf.VnfAdapterUtils;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.utils.MsoHeatUtils;
import com.woorea.openstack.heat.model.Stack;
}
@Test
- public void testExecuteExternalTask() throws VnfException, MsoException, IOException {
+ public void testExecuteExternalTask() throws VnfException, IOException {
String payload = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "/vnfAdapterTaskRequestCreate.xml")));
Stack stack = new Stack();
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackGetWithResponse;
-import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
return vfModuleCustomization;
}
- public static void mockUpdateRequestDb(WireMockServer wireMockServer, String requestId) throws IOException {
+ public static void mockUpdateRequestDb(WireMockServer wireMockServer, String requestId) {
wireMockServer.stubFor(patch(urlPathEqualTo("/infraActiveRequests/" + requestId))
.willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK)));
}
.withBodyFile("OpenstackResponse_Tenant.json").withStatus(HttpStatus.SC_OK)));
}
- public static void mockOpenStackPostTenant_200(WireMockServer wireMockServer) throws IOException {
+ public static void mockOpenStackPostTenant_200(WireMockServer wireMockServer) {
wireMockServer.stubFor(post(urlPathEqualTo("/mockPublicUrl/tenants"))
.willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK)));
}
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
import org.onap.aaiclient.client.graphinventory.entities.DSLQuery;
import org.onap.aaiclient.client.graphinventory.entities.Pathed;
-import org.onap.aaiclient.client.graphinventory.exceptions.BulkProcessFailed;
import org.onap.so.cloud.resource.beans.NodeType;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.heatbridge.constants.HeatBridgeConstants;
import org.onap.so.heatbridge.helpers.AaiHelper;
import org.onap.so.heatbridge.openstack.api.OpenstackClient;
-import org.onap.so.heatbridge.openstack.api.OpenstackClientException;
import org.openstack4j.model.compute.Flavor;
import org.openstack4j.model.compute.Image;
import org.openstack4j.model.compute.Server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
@Before
- public void setUp() throws HeatBridgeException, OpenstackClientException, BulkProcessFailed {
+ public void setUp() {
when(resourcesClient.beginSingleTransaction()).thenReturn(transaction);
}
@Test
- public void testExtractStackResourceIdsByResourceType() throws HeatBridgeException {
+ public void testExtractStackResourceIdsByResourceType() {
// Arrange
List<Resource> expectedResourceList = (List<Resource>) extractTestStackResources();
List<String> expectedServerIds =
}
@Test
- public void testUpdateVserverLInterfacesToAai()
- throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
+ public void testUpdateVserverLInterfacesToAai() throws HeatBridgeException, JsonMappingException, IOException {
// Arrange
List<Resource> stackResources = (List<Resource>) extractTestStackResources();
Port port = mock(Port.class);
}
@Test
- public void testUpdateNetworksToAai() throws HeatBridgeException {
+ public void testUpdateNetworksToAai() {
Subnet subnet1 = mock(Subnet.class);
when(subnet1.getId()).thenReturn("test-subnet1-id");
}
@Test
- public void testUpdateLInterfaceIps()
- throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
+ public void testUpdateLInterfaceIps() {
Port port = mock(Port.class);
when(port.getNetworkId()).thenReturn("890a203a-23gg-56jh-df67-731656a8f13a");
}
@Test
- public void testUpdateVserverLInterfacesToAai_skipVlans()
- throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
+ public void testUpdateVserverLInterfacesToAai_skipVlans() throws HeatBridgeException {
// Arrange
List<Resource> stackResources = (List<Resource>) extractTestStackResources();
Port port = mock(Port.class);
}
@Test
- public void testBuildAddVserverLInterfacesToAaiAction_PortProfileNull()
- throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
+ public void testBuildAddVserverLInterfacesToAaiAction_PortProfileNull() throws HeatBridgeException {
// Arrange
List<Resource> stackResources = (List<Resource>) extractTestStackResources();
Port port = mock(Port.class);
}
@Test
- public void testBuildAddVserverLInterfacesToAaiAction_DeviceIdNull()
- throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
+ public void testBuildAddVserverLInterfacesToAaiAction_DeviceIdNull() throws HeatBridgeException {
// Arrange
List<Resource> stackResources = (List<Resource>) extractTestStackResources();
Port port = mock(Port.class);
}
@Test
- public void testExtractOpenstackImagesFromServers() throws HeatBridgeException {
+ public void testExtractOpenstackImagesFromServers() {
// Arrange
List<Server> serverList = new ArrayList<>();
serverList.add(server);
@PutMapping(value = "/orchestrationTask/{taskId}")
public OrchestrationTask updateOrchestrationTask(@PathVariable("taskId") String taskId,
- @RequestBody OrchestrationTask orchestrationTask) throws MsoRequestsDbException {
+ @RequestBody OrchestrationTask orchestrationTask) {
return orchestrationTaskRepository.save(orchestrationTask);
}
}
@Test
- public void getSiteStatusNotDisabled() throws MsoRequestsDbException {
+ public void getSiteStatusNotDisabled() {
setupTestEntities();
// Given
String siteName = "siteName";
}
@Test
- public void getSiteStatusDisabled() throws MsoRequestsDbException {
+ public void getSiteStatusDisabled() {
setupTestEntities();
// Given
String siteName = "testSite";
public class MsoRequestsDbExceptionTest {
@Test
- public void testConstructorWithMessaqge() throws Exception {
+ public void testConstructorWithMessaqge() {
String message = "testing message";
MsoRequestsDbException msoRequestsDbException = new MsoRequestsDbException(message);
Assert.assertNull(msoRequestsDbException.getCause());
}
@Test
- public void testConstructorWithThrowable() throws Exception {
+ public void testConstructorWithThrowable() {
String message = "testing message";
Throwable throwable = new Throwable(message);
MsoRequestsDbException msoRequestsDbException = new MsoRequestsDbException(throwable);
}
@Test
- public void testConstructorWithMessageAndThrowable() throws Exception {
+ public void testConstructorWithMessageAndThrowable() {
String message = "testing message";
String tMessage = "throwable message";
Throwable throwable = new Throwable(tMessage);
}
@Test
- public void sendTest() throws IOException {
+ public void sendTest() {
ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.OK);
doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
}
@Test
- public void sendNoAuthHeaderTest() throws IOException {
+ public void sendNoAuthHeaderTest() {
doReturn(true).when(bpRestCallback).setAuthorizationHeader(headers);
doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
}
@Test
- public void sendErrorTest() throws IOException {
+ public void sendErrorTest() {
doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
when(restTemplate.postForEntity(uri, requestEntity, String.class))
}
@Test
- public void sendResponse3xxTest() throws IOException {
+ public void sendResponse3xxTest() {
ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.MULTIPLE_CHOICES);
doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
}
@Test
- public void sendResponseNullMessageTest() throws IOException {
+ public void sendResponseNullMessageTest() {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> requestEntityNoMessage = new HttpEntity<>(null, httpHeaders);
}
@Test
- public void postThrowsExceptionTest() throws IOException {
+ public void postThrowsExceptionTest() {
doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
when(restTemplate.postForEntity(uri, requestEntity, String.class))
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 {
+ String requestorId) {
Object requestObject;
requestObject = createRequest(action, actionIdentifiers, payload, requestID, requestorId);
appCSupport.logLCMMessage(requestObject);
}
@Test
- public void onResponse_appcCallback_success_Test() throws Exception {
+ public void onResponse_appcCallback_success_Test() {
Status status = new Status();
status.setCode(400);
ResumeTrafficOutput response = new ResumeTrafficOutput();
}
@Test
- public void onResponse_appcCallback_intermediateResponse_Test() throws Exception {
+ public void onResponse_appcCallback_intermediateResponse_Test() {
Status status = new Status();
status.setCode(100);
ResumeTrafficOutput response = new ResumeTrafficOutput();
}
@Test
- public void onResponse_appcCallback_failure_Test() throws Exception {
+ public void onResponse_appcCallback_failure_Test() {
String testFailure = "test failure";
Status status = new Status();
status.setCode(200);
}
@Test
- public void onException_appcCallback_failure_Test() throws Exception {
+ public void onException_appcCallback_failure_Test() {
String testFailure = "test failure";
AppcClientException appcException = new AppcClientException(testFailure);
Status status = new Status();
@Test
@Parameters(method = "statusesAndCategories")
- public void shouldReturnCategoryForCode(int code, StatusCategory category) throws Exception {
+ public void shouldReturnCategoryForCode(int code, StatusCategory category) {
// when
StatusCategory detectedCategory = applicationControllerSupport.getCategoryOf(createStatus(code));
// then
@Test
@Parameters(method = "statusesAndFinalities")
- public void shouldReturnFinalityForCode(int code, boolean expectedFinality) throws Exception {
+ public void shouldReturnFinalityForCode(int code, boolean expectedFinality) {
// when
boolean finality = applicationControllerSupport.getFinalityOf(createStatus(code));
// then
}
@Test
- public void CertifyActivitySpec_Test() throws Exception {
+ public void CertifyActivitySpec_Test() {
String HOSTNAME = createURLWithPort("");
String activitySpecId = "testActivitySpec";
}
@Test
- public void CertifyActivitySpecReturnsExists_Test() throws Exception {
+ public void CertifyActivitySpecReturnsExists_Test() {
String HOSTNAME = createURLWithPort("");
String activitySpecId = "testActivitySpec";
@Transactional
@Test
- public void installWorkflowResource_Test() throws Exception {
+ public void installWorkflowResource_Test() {
Workflow workflow = new Workflow();
workflow.setArtifactChecksum("12345");
private static final String LOCAL_HOST = "http://localhost:";
@BeforeClass
- public static void setup() throws Exception {
+ public static void setup() {
System.setProperty("mso.config.path", "src/test/resources");
}
public class ASDCNotificationLoggingTest {
@Test
- public void dumpASDCNotificationTestForNull() throws Exception {
+ public void dumpASDCNotificationTestForNull() {
INotificationData asdcNotification = iNotificationDataObject();
String result = ASDCNotificationLogging.dumpASDCNotification(asdcNotification);
}
@Test
- public void dumpASDCNotificationTest() throws Exception {
+ public void dumpASDCNotificationTest() {
INotificationData asdcNotification = iNotificationDataObject();
String result = ASDCNotificationLogging.dumpASDCNotification(asdcNotification);
}
public org.onap.aai.domain.yang.ServiceInstance getAAIServiceInstanceByName(String serviceInstanceName,
- Customer customer) throws Exception {
+ Customer customer) {
Optional<org.onap.aai.domain.yang.ServiceInstance> aaiServiceInstance = injectionHelper.getAaiClient().getOne(
ServiceInstances.class, org.onap.aai.domain.yang.ServiceInstance.class,
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(customer.getGlobalCustomerId())
}
public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVfModule(String vnfId, String vfModuleId,
- String volumeGroupName) throws Exception {
+ String volumeGroupName) {
AAIPluralResourceUri uri =
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
.relatedTo(Types.VOLUME_GROUPS.getFragment()).queryParam("volume-group-name", volumeGroupName);
return injectionHelper.getAaiClient().getOne(VolumeGroups.class, VolumeGroup.class, uri);
}
- public Optional<VolumeGroup> getRelatedVolumeGroupFromVfModule(String vnfId, String vfModuleId) throws Exception {
+ public Optional<VolumeGroup> getRelatedVolumeGroupFromVfModule(String vnfId, String vfModuleId) {
AAIPluralResourceUri uri =
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
.relatedTo(Types.VOLUME_GROUPS.getFragment());
}
public Status runCommand(Action action, org.onap.appc.client.lcm.model.ActionIdentifiers actionIdentifiers,
- org.onap.appc.client.lcm.model.Payload payload, String requestID)
- throws ApplicationControllerOrchestratorException {
+ org.onap.appc.client.lcm.model.Payload payload, String requestID) {
Object requestObject;
requestObject = createRequest(action, actionIdentifiers, payload, requestID);
appCSupport.logLCMMessage(requestObject);
}
@Test
- public void getResourceInputTest() throws Exception {
+ public void getResourceInputTest() {
VnfResource resource = new VnfResource();
resource.setResourceType(ResourceType.VNF);
}
@Test
- public void getResourceInputDefaultValueTest() throws Exception {
+ public void getResourceInputDefaultValueTest() {
VnfResource resource = new VnfResource();
resource.setResourceType(ResourceType.VNF);
resource.setResourceInput("{\"a\":\"key|default_value\"}");
}
@Test
- public void getResourceInputValueNoDefaultTest() throws Exception {
+ public void getResourceInputValueNoDefaultTest() {
VnfResource resource = new VnfResource();
resource.setResourceType(ResourceType.VNF);
resource.setResourceInput("{\"a\":\"value\"}");
}
@Test
- public void getResourceSequenceTest() throws Exception {
+ public void getResourceSequenceTest() {
wireMockServer.stubFor(get(urlEqualTo(
"/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
}
@Test
- public void getResourceInputWithEmptyServiceResourcesTest() throws Exception {
+ public void getResourceInputWithEmptyServiceResourcesTest() {
VnfResource resource = new VnfResource();
resource.setResourceType(ResourceType.VNF);
}
@Test
- public void getListResourceInputTest() throws Exception {
+ public void getListResourceInputTest() {
List<Map> vnfdata = null;
import org.onap.so.db.catalog.beans.VnfcCustomization;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.RequestDetails;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class BBInputSetupMapperLayerTest {
}
@Test
- public void testMapAAINetworkPolicy() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAINetworkPolicy() throws IOException {
NetworkPolicy expectedNetworkPolicy =
mapper.readValue(new File(RESOURCE_PATH + "NetworkPolicy.json"), NetworkPolicy.class);
}
@Test
- public void testMapAAIVolumeGroup() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAIVolumeGroup() throws IOException {
VolumeGroup expectedVolumeGroup =
mapper.readValue(new File(RESOURCE_PATH + "VolumeGroup.json"), VolumeGroup.class);
}
@Test
- public void testMapAAICollectionIntoCollection() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAICollectionIntoCollection() throws IOException {
org.onap.aai.domain.yang.Collection aaiCollection = mapper
.readValue(new File(RESOURCE_PATH + "CollectionInput.json"), org.onap.aai.domain.yang.Collection.class);
}
@Test
- public void testMapAAIInstanceGroupIntoInstanceGroup()
- throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAIInstanceGroupIntoInstanceGroup() throws IOException {
org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup = mapper.readValue(
new File(RESOURCE_PATH + "InstanceGroupInput.json"), org.onap.aai.domain.yang.InstanceGroup.class);
}
@Test
- public void testMapAAIRouteTableReferenceIntoRouteTableReference()
- throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAIRouteTableReferenceIntoRouteTableReference() throws IOException {
org.onap.aai.domain.yang.RouteTableReference aaiRouteTableReference =
mapper.readValue(new File(RESOURCE_PATH + "RouteTableReferenceInput.json"),
org.onap.aai.domain.yang.RouteTableReference.class);
}
@Test
- public void testMapCatalogNetworkToNetwork() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapCatalogNetworkToNetwork() throws IOException {
NetworkResourceCustomization networkResourceCustomization = mapper.readValue(
new File(RESOURCE_PATH + "NetworkResourceCustomizationInput.json"), NetworkResourceCustomization.class);
}
@Test
- public void testMapCatalogVfModuleToVfModule() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapCatalogVfModuleToVfModule() throws IOException {
VfModuleCustomization vfResourceCustomization = mapper
.readValue(new File(RESOURCE_PATH + "VfModuleCustomizationInput.json"), VfModuleCustomization.class);
}
@Test
- public void testMapRequestPlatform() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapRequestPlatform() throws IOException {
org.onap.so.serviceinstancebeans.Platform platform = mapper.readValue(
new File(RESOURCE_PATH + "RequestPlatformInput.json"), org.onap.so.serviceinstancebeans.Platform.class);
}
@Test
- public void testMapRequestLineOfBusiness() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapRequestLineOfBusiness() throws IOException {
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness =
mapper.readValue(new File(RESOURCE_PATH + "RequestLineOfBusinessInput.json"),
org.onap.so.serviceinstancebeans.LineOfBusiness.class);
}
@Test
- public void testMapAAIConfiguration() throws JsonParseException, JsonMappingException, IOException {
+ public void testMapAAIConfiguration() throws IOException {
org.onap.aai.domain.yang.Configuration configurationAAI = mapper.readValue(
new File(RESOURCE_PATH + "ConfigurationInput.json"), org.onap.aai.domain.yang.Configuration.class);
import org.onap.so.serviceinstancebeans.RequestParameters;
import org.onap.so.serviceinstancebeans.Resources;
import org.onap.so.serviceinstancebeans.SubscriberInfo;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.onap.so.serviceinstancebeans.VfModules;
import org.onap.so.serviceinstancebeans.Vnfs;
}
@Test
- public void testGetCustomerAndServiceSubscription() throws JsonParseException, JsonMappingException, IOException {
+ public void testGetCustomerAndServiceSubscription() throws IOException {
RequestDetails requestDetails = mapper.readValue(
new File(RESOURCE_PATH + "RequestDetailsInput_withRelatedInstanceList.json"), RequestDetails.class);
SubscriberInfo subscriberInfo = new SubscriberInfo();
}
@Test
- public void testGetExecuteBBFromExecution() throws IOException {
+ public void testGetExecuteBBFromExecution() {
BuildingBlock bb = new BuildingBlock().setBpmnFlowName("AssignServiceInstanceBB");
ExecuteBuildingBlock expected =
new ExecuteBuildingBlock().setBuildingBlock(bb).setRequestId("00032ab7-3fb3-42e5-965d-8ea592502017");
}
@Test
- public void testGetServiceSubscription() throws IOException {
+ public void testGetServiceSubscription() {
ServiceSubscription expected = new ServiceSubscription();
RequestDetails requestDetails = new RequestDetails();
RequestParameters params = new RequestParameters();
}
@Test
- public void testGetCustomer() throws IOException {
+ public void testGetCustomer() {
Customer expected = new Customer();
RequestDetails requestDetails = new RequestDetails();
SubscriberInfo subscriberInfo = new SubscriberInfo();
}
@Test
- public void testPopulateInstanceGroup() throws Exception {
+ public void testPopulateInstanceGroup() {
ModelInfo modelInfo = Mockito.mock(ModelInfo.class);
Service service = Mockito.mock(Service.class);
List<InstanceGroup> instanceGroups = Mockito.spy(new ArrayList<>());
}
@Test
- public void testIsVlanTagging() throws Exception {
+ public void testIsVlanTagging() {
boolean expected = true;
Service service = Mockito.mock(Service.class);
String key = "collectionCustId";
}
@Test
- public void testPopulateL3Network() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateL3Network() throws IOException {
String instanceName = "networkName";
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelType(ModelType.network);
}
@Test
- public void testPopulateConfiguration() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateConfiguration() throws IOException {
String instanceName = "configurationName";
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationUuid("72d9d1cd-f46d-447a-abdb-451d6fb05fa9");
}
@Test
- public void testPopulateConfigurationReplace() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateConfigurationReplace() throws IOException {
String instanceName = "configurationName";
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationUuid("72d9d1cd-f46d-447a-abdb-451d6fb05fa9");
}
@Test
- public void testPopulateFabricConfiguration() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateFabricConfiguration() throws IOException {
String instanceName = "configurationName";
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationUuid("72d9d1cd-f46d-447a-abdb-451d6fb05fa9");
}
@Test
- public void testPopulateGenericVnf() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateGenericVnf() throws IOException {
org.onap.so.serviceinstancebeans.Platform platform = new org.onap.so.serviceinstancebeans.Platform();
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness =
new org.onap.so.serviceinstancebeans.LineOfBusiness();
}
@Test
- public void testPopulateGenericVnfReplace() throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateGenericVnfReplace() throws IOException {
org.onap.so.serviceinstancebeans.Platform platform = new org.onap.so.serviceinstancebeans.Platform();
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness =
new org.onap.so.serviceinstancebeans.LineOfBusiness();
}
@Test
- public void testPopulateGenericVnfWhereVnfTypeIsNull()
- throws JsonParseException, JsonMappingException, IOException {
+ public void testPopulateGenericVnfWhereVnfTypeIsNull() throws IOException {
org.onap.so.serviceinstancebeans.Platform platform = new org.onap.so.serviceinstancebeans.Platform();
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness =
new org.onap.so.serviceinstancebeans.LineOfBusiness();
}
@Test
- public void testMapCustomer() throws Exception {
+ public void testMapCustomer() {
org.onap.aai.domain.yang.Customer customerAAI = new org.onap.aai.domain.yang.Customer();
org.onap.aai.domain.yang.ServiceSubscription serviceSubscriptionAAI =
new org.onap.aai.domain.yang.ServiceSubscription();
}
@Test
- public void getOptionalAAIServiceInstanceByNameNullTest() throws Exception {
+ public void getOptionalAAIServiceInstanceByNameNullTest() {
Optional<ServiceInstance> actual = bbInputSetupUtils.getAAIServiceInstanceByName("", "", "");
assertThat(actual, sameBeanAs(Optional.empty()));
}
@Test
- public void getRelatedVnfByNameFromServiceInstanceTest() throws Exception {
+ public void getRelatedVnfByNameFromServiceInstanceTest() {
final String vnfId = "id123";
final String vnfName = "name123";
final String serviceInstanceId = "service-instance-id123";
}
@Test
- public void getRelatedVnfByNameFromServiceInstanceNotFoundTest() throws Exception {
+ public void getRelatedVnfByNameFromServiceInstanceNotFoundTest() {
final String serviceInstanceId = "serviceInstanceId";
final String vnfName = "vnfName";
}
@Test
- public void getRelatedVolumeGroupByNameFromVnfTest() throws Exception {
+ public void getRelatedVolumeGroupByNameFromVnfTest() {
final String vnfId = "vnf-id123";
final String volumeGroupId = "id123";
final String volumeGroupName = "volume-group-name123";
}
@Test
- public void getRelatedVolumeGroupByNameFromVnfNotFoundTest() throws Exception {
+ public void getRelatedVolumeGroupByNameFromVnfNotFoundTest() {
String vnfId = "vnfId";
String volumeGroupName = "volumeGroupName";
}
@Test
- public void getRelatedConfigurationByNameFromServiceInstanceNotFoundTest() throws Exception {
+ public void getRelatedConfigurationByNameFromServiceInstanceNotFoundTest() {
assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("", ""));
}
@Test
- public void getRelatedConfigurationByNameFromServiceInstanceTest() throws Exception {
+ public void getRelatedConfigurationByNameFromServiceInstanceTest() {
Configuration configuration = new Configuration();
configuration.setConfigurationId("id123");
doReturn(Optional.of(configuration)).when(MOCK_aaiResourcesClient).getOne(Configurations.class,
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(MockitoJUnitRunner.class)
}
@Test
- public void testGetCloudInfoFromAAI() throws JsonParseException, JsonMappingException, IOException {
+ public void testGetCloudInfoFromAAI() throws IOException {
// Test vnfs
ServiceInstance serviceInstance =
mapper.readValue(new File(RESOURCE_PATH + "ServiceInstance_getServiceInstanceNOAAIExpected.json"),
}
@Test
- public void setRetryTimerTest() throws Exception {
+ public void setRetryTimerTest() {
delegateExecution.setVariable("retryCount", 2);
executeBuildingBlockRainyDay.setRetryTimer(delegateExecution);
assertEquals("PT40S", delegateExecution.getVariable("RetryDuration"));
}
@Test
- public void queryRainyDayTableExists() throws Exception {
+ public void queryRainyDayTableExists() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableDefault() throws Exception {
+ public void queryRainyDayTableDefault() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableDoesNotExist() throws Exception {
+ public void queryRainyDayTableDoesNotExist() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableSecondaryPolicyExists() throws Exception {
+ public void queryRainyDayTableSecondaryPolicyExists() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableRollbackToAssignedMacro() throws Exception {
+ public void queryRainyDayTableRollbackToAssignedMacro() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableRollbackToAssignedALaCarte() throws Exception {
+ public void queryRainyDayTableRollbackToAssignedALaCarte() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableRollbackToCreated() throws Exception {
+ public void queryRainyDayTableRollbackToCreated() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
}
@Test
- public void queryRainyDayTableRollbackToCreatedNoConfiguration() throws Exception {
+ public void queryRainyDayTableRollbackToCreatedNoConfiguration() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
@Test
- public void suppressRollbackTest() throws Exception {
+ public void suppressRollbackTest() {
delegateExecution.setVariable("suppressRollback", true);
delegateExecution.setVariable("aLaCarte", true);
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
}
@Test
- public void queryRainyDayTableServiceRoleNotDefined() throws Exception {
+ public void queryRainyDayTableServiceRoleNotDefined() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
serviceInstance.getModelInfoServiceInstance().setServiceRole("sr1");
}
@Test
- public void queryRainyDayTableServiceRoleNC() throws Exception {
+ public void queryRainyDayTableServiceRoleNC() {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
serviceInstance.getModelInfoServiceInstance().setServiceRole("NETWORK-COLLECTION");
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import java.io.UnsupportedEncodingException;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.ForbiddenException;
import javax.ws.rs.InternalServerErrorException;
}
@Test
- public void shouldThrowExceptionWithCustomMessageWhenResponseHasEntity() throws UnsupportedEncodingException {
+ public void shouldThrowExceptionWithCustomMessageWhenResponseHasEntity() {
// given
Response response = createMockResponse(Status.BAD_REQUEST);
when(response.hasEntity()).thenReturn(true);
@Test
@Parameters(method = "statusesAndCategories")
- public void shouldReturnCategoryForCode(int code, StatusCategory category) throws Exception {
+ public void shouldReturnCategoryForCode(int code, StatusCategory category) {
// when
StatusCategory detectedCategory = ApplicationControllerSupport.getCategoryOf(createStatus(code));
// then
@Test
@Parameters(method = "statusesAndFinalities")
- public void shouldReturnFinalityForCode(int code, boolean expectedFinality) throws Exception {
+ public void shouldReturnFinalityForCode(int code, boolean expectedFinality) {
// when
boolean finality = ApplicationControllerSupport.getFinalityOf(createStatus(code));
// then
}
@Test
- public void preProcessRequestDETest() throws Exception {
+ public void preProcessRequestDETest() {
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable("executionObject")).thenReturn(abstractCDSPropertiesBean);
}
@Test
- public void preProcessRequestBBTest() throws Exception {
+ public void preProcessRequestBBTest() {
BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
when(execution.getVariable("executionObject")).thenReturn(abstractCDSPropertiesBean);
import org.mockito.Mockito;
import org.onap.so.BaseTest;
import org.onap.so.client.avpn.dmaap.beans.AVPNDmaapBean;
-import org.onap.so.client.exception.MapperException;
import org.springframework.beans.factory.annotation.Autowired;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class DmaapPropertiesClientTest extends BaseTest {
private String percentProgress = "100";
@Test
- public void testBuildRequestJson() throws MapperException, IOException {
+ public void testBuildRequestJson() throws IOException {
AVPNDmaapBean actualBean = dmaapPropertiesClient.buildRequestJson(requestId, clientSource, correlator,
serviceInstanceId, startTime, finishTime, requestScope, requestType, timestamp, requestState,
statusMessage, percentProgress, true);
}
@Test
- public void testDmaapPublishRequest() throws JsonProcessingException, MapperException {
+ public void testDmaapPublishRequest() {
DmaapPropertiesClient client = Mockito.spy(DmaapPropertiesClient.class);
GlobalDmaapPublisher mockedClientDmaapPublisher = Mockito.mock(GlobalDmaapPublisher.class);
AVPNDmaapBean mockedDmaapBean = Mockito.mock(AVPNDmaapBean.class);
public class GlobalDmaapPublisherTest extends BaseTest {
@BeforeClass
- public static void setUp() throws Exception {
+ public static void setUp() {
System.setProperty("mso.global.dmaap.host", "http://test:1234");
}
package org.onap.so.client.restproperties;
import static org.junit.Assert.assertEquals;
-import java.net.MalformedURLException;
import org.junit.Test;
public class AAIPropertiesImplTest {
private AAIPropertiesImpl aaiPropertiesImpl = new AAIPropertiesImpl();
@Test
- public void getEndpointTest() throws MalformedURLException {
+ public void getEndpointTest() {
assertEquals("aai.endpoint", AAIPropertiesImpl.AAI_ENDPOINT);
}
package org.onap.so.client.restproperties;
import static org.junit.Assert.assertEquals;
-import java.net.MalformedURLException;
import org.junit.Test;
public class PolicyRestPropertiesImplTest {
@Test
- public void getEndpointTest() throws MalformedURLException {
+ public void getEndpointTest() {
assertEquals("policy.endpoint", PolicyRestPropertiesImpl.POLICY_ENDPOINT);
}
private Object obj;
@Before
- public void before() throws Exception {
+ public void before() {
responseBuilder = new ResponseBuilder();
ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class);
when(mockProcessDefinition.getKey()).thenReturn(processKey);
private static final String VALUE_2 = "value2";
@Test
- public void shouldReturnStringRepresentationOfDataInAnyPermutation() throws Exception {
+ public void shouldReturnStringRepresentationOfDataInAnyPermutation() {
// given
RollbackData data = new RollbackData();
data.put(TYPE_A, KEY_1, VALUE_1);
}
@Test
- public void shouldBeEmptyOnCreation() throws Exception {
+ public void shouldBeEmptyOnCreation() {
// given
RollbackData data = new RollbackData();
// then
}
@Test
- public void shouldHaveTypeAfterPuttingDataOfThatType() throws Exception {
+ public void shouldHaveTypeAfterPuttingDataOfThatType() {
// given
RollbackData data = new RollbackData();
// when
}
@Test
- public void shouldKeepTwoValuesWithSameKeysButDifferentTypes() throws Exception {
+ public void shouldKeepTwoValuesWithSameKeysButDifferentTypes() {
// given
RollbackData data = new RollbackData();
// when
import java.util.Arrays;
import org.junit.Before;
import org.junit.Test;
-import com.fasterxml.jackson.core.JsonProcessingException;
public class ServiceDecompositionTest {
private static final String RESOURCE_PATH = "src/test/resources/json-examples/";
}
@Test
- public void serviceDecompositionTest() throws JsonProcessingException, IOException {
+ public void serviceDecompositionTest() throws IOException {
// covering methods not covered by openpojo test
String catalogRestOutput =
new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "ServiceDecomposition.json")));
public class VariableNameExtractorTest {
@Test
- public void shouldExtractVariableName() throws Exception {
+ public void shouldExtractVariableName() {
// given
String name = "A_different_NAME123";
String variable = "${A_different_NAME123}";
}
@Test
- public void shouldExtractVariableNameFromWhitespaces() throws Exception {
+ public void shouldExtractVariableNameFromWhitespaces() {
// given
String name = "name";
String variable = " \n\t$ \n\t{ \n\tname \n\t} \n\t";
}
@Test
- public void shouldReturnEmptyIfThereIsMoreThanVariable() throws Exception {
+ public void shouldReturnEmptyIfThereIsMoreThanVariable() {
// given
String variable = "a ${test}";
VariableNameExtractor extractor = new VariableNameExtractor(variable);
}
@Test
- public void shouldReturnEmptyIfVariableNameIsIncorrect() throws Exception {
+ public void shouldReturnEmptyIfVariableNameIsIncorrect() {
// given
String variable = "${name with space}";
VariableNameExtractor extractor = new VariableNameExtractor(variable);
}
@Test
- public void shouldReturnEmptyIfTwoVariablesPresent() throws Exception {
+ public void shouldReturnEmptyIfTwoVariablesPresent() {
// given
String variable = "${var1} ${var2}";
VariableNameExtractor extractor = new VariableNameExtractor(variable);
public ExpectedException expectedException = ExpectedException.none();
@Before
- public void before() throws Exception {
+ public void before() {
}
}
@Test
- public void shouldConvertXmlToJsonAndBackToSameXml() throws Exception {
+ public void shouldConvertXmlToJsonAndBackToSameXml() {
// Note: the current version of the JsonUtils.json2xml() method
// does not support converting the JSONObject representation
// of XML attributes (JSONArray) back to XML. So this test will
}
@Test
- public void shouldReadValuesForAbsoluteJsonPaths() throws Exception {
+ public void shouldReadValuesForAbsoluteJsonPaths() {
// given
String json = JsonUtils.xml2json(XML_REQ);
// when, then
}
@Test
- public void shouldReturnValueForJsonKey() throws Exception {
+ public void shouldReturnValueForJsonKey() {
// given
String json = JsonUtils.xml2json(XML_REQ);
// when, then
}
@Test
- public void shouldReturnNullForNonexistentJsonNode() throws Exception {
+ public void shouldReturnNullForNonexistentJsonNode() {
// given
String json = JsonUtils.xml2json(XML_REQ);
// when, then
}
@Test
- public void shouldReturnNullForNonExistentParameter() throws Exception {
+ public void shouldReturnNullForNonExistentParameter() {
// given
String json = JsonUtils.xml2json(XML_REQ);
// when, then
}
@Test
- public void shouldGetJasonParametersFromArray() throws Exception {
+ public void shouldGetJasonParametersFromArray() {
// given
String json = JsonUtils.xml2json(XML_REQ);
// when, then
}
@Test
- public void shouldAddJsonValue() throws Exception {
+ public void shouldAddJsonValue() {
// given
String json = JsonUtils.xml2json(XML_REQ);
String key = "vnf-request.request-info.comment";
}
@Test
- public void shouldIgnoreAddIfFieldAlreadyExists() throws Exception {
+ public void shouldIgnoreAddIfFieldAlreadyExists() {
// given
String json = JsonUtils.xml2json(XML_REQ);
String key = "vnf-request.vnf-inputs.vnf-name";
}
@Test
- public void shouldUpdateValueInJson() throws Exception {
+ public void shouldUpdateValueInJson() {
// given
String json = JsonUtils.xml2json(XML_REQ);
String key = "vnf-request.vnf-inputs.vnf-name";
}
@Test
- public void shouldReturnOriginalJsonWhenTryingToRemoveNonexistentField() throws Exception {
+ public void shouldReturnOriginalJsonWhenTryingToRemoveNonexistentField() {
// given
String json = JsonUtils.xml2json(XML_REQ);
String key = "vnf-request.vnf-inputs.does-not-exist";
}
@Test
- public void shouldConvertJsonContainingArrayToXml() throws Exception {
+ public void shouldConvertJsonContainingArrayToXml() {
// when
String jsonParm = JsonUtils.getJsonNodeValue(jsonReqArray, "requestDetails.requestParameters.ucpeInfo");
String xmlOut = JsonUtils.json2xml(jsonParm);
}
@Test
- public void xml2jsonTest() throws IOException {
+ public void xml2jsonTest() {
String expectedJson = "{\"name\":\"myName\"}";
String xml = "<name>myName</name>";
assertEquals(expectedJson, JsonUtils.xml2json(xml, false));
}
@Test
- public void xml2jsonErrorTest() throws IOException {
+ public void xml2jsonErrorTest() {
String malformedXml = "<name>myName<name>";
assertNull(JsonUtils.xml2json(malformedXml));
}
@Test
- public void json2xmlTest() throws IOException {
+ public void json2xmlTest() {
String expectedXml = "<name>myName</name>";
String malformedJson = "{\"name\":\"myName\"}";
assertEquals(expectedXml, JsonUtils.json2xml(malformedJson, false));
}
@Test
- public void json2xmlErrorTest() throws IOException {
+ public void json2xmlErrorTest() {
String malformedJson = "{\"name\" \"myName\"}";
assertNull(JsonUtils.json2xml(malformedJson));
}
}
@Test
- public void getJsonValueForKeyErrorTest() throws IOException {
+ public void getJsonValueForKeyErrorTest() {
String malformedJson = "{\"name\" \"myName\"}";
assertNull(JsonUtils.getJsonValueForKey(malformedJson, "name"));
}
@Test
- public void updJsonValueTest() throws IOException {
+ public void updJsonValueTest() {
String expectedJson = "{\"name\": \"yourName\"}";
String json = "{\"name\":\"myName\"}";
assertEquals(expectedJson, JsonUtils.updJsonValue(json, "name", "yourName"));
}
@Test
- public void updJsonValueErrorTest() throws IOException {
+ public void updJsonValueErrorTest() {
String expectedJson = "{\"name\" \"myName\"}";
String json = "{\"name\" \"myName\"}";
assertEquals(expectedJson, JsonUtils.updJsonValue(json, "name", "yourName"));
* 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.
/**
* Executes the Asynchronous workflow in synchronous fashion and returns the WorkflowResponse object
- *
+ *
* @param processEngineServices
* @param processKey
* @param variables
/**
* Execute workflow using async resource
- *
+ *
* @param processEngineServices
* @param processKey
* @param asyncResponse
* @throws InterruptedException
*/
private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey,
- Map<String, String> variables) throws InterruptedException {
+ Map<String, String> variables) {
VariableMapImpl variableMap = new VariableMapImpl();
Map<String, Object> variableValueType = new HashMap<>();
* workflowResponse.setResponse(workflowResponseString); workflowResponse.setMessageCode(200); } return
* null; } }).when(asyncResponse).setResponse(any(Response.class));
*/
- try {
- executeAsyncFlow(processEngineServices, processKey, variables);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ executeAsyncFlow(processEngineServices, processKey, variables);
}
}
}
public class ConfirmVolumeGroupTenantIT extends BaseIntegrationTest {
@Test
- public void testRemoveLayer3Service_success() throws Exception {
+ public void testRemoveLayer3Service_success() {
MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58",
"CRTGVNF_queryAAIResponseVolume.xml");
}
@Test
- public void testRemoveLayer3Service_idsNotMatch() throws Exception {
+ public void testRemoveLayer3Service_idsNotMatch() {
MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58",
"CRTGVNF_queryAAIResponseVolume_idsNotMatch.xml");
import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetVfModuleId;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutVfModuleId;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
* Test the happy path through the flow.
*/
@Test
- public void happyPath() throws IOException {
+ public void happyPath() {
logStart();
* Test the case where the GET to AAI returns a 404.
*/
@Test
- public void badGet() throws IOException {
+ public void badGet() {
logStart();
* Test the case where the GET to AAI is successful, but he subsequent PUT returns 404.
*/
@Test
- public void badPatch() throws IOException {
+ public void badPatch() {
logStart();
}
@Test
- public void testDecomposeService_success() throws Exception {
+ public void testDecomposeService_success() {
MockGetServiceResourcesCatalogData(wireMockServer, "cmw-123-456-789", "1.0",
"/getCatalogServiceResourcesDataWithConfig.json");
// @Test
@Test
- public void testDecomposeService_success_partial() throws Exception {
+ public void testDecomposeService_success_partial() {
MockGetServiceResourcesCatalogData(wireMockServer, "cmw-123-456-789", "1.0",
"/getCatalogServiceResourcesDataNoNetwork.json");
}
@Test
- public void testHoming_success_2AR1Vnf() throws Exception {
+ public void testHoming_success_2AR1Vnf() {
mockOof(wireMockServer);
}
@Test
- public void testHoming_success_2AR1Vnf2Net() throws Exception {
+ public void testHoming_success_2AR1Vnf2Net() {
mockOof(wireMockServer);
}
@Test
- public void testHoming_success_vnfResourceList() throws Exception {
+ public void testHoming_success_vnfResourceList() {
// Create a Service Decomposition
MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4",
}
@Test
- public void testHoming_success_existingLicense() throws Exception {
+ public void testHoming_success_existingLicense() {
mockOof(wireMockServer);
}
@Test
- public void testHoming_error_inputVariable() throws Exception {
+ public void testHoming_error_inputVariable() {
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
}
@Test
- public void testHoming_error_badResponse() throws Exception {
+ public void testHoming_error_badResponse() {
mockOof_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
}
@Test
- public void testHoming_error_oofNoSolution() throws Exception {
+ public void testHoming_error_oofNoSolution() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
}
@Test
- public void testHoming_error_oofPolicyException() throws Exception {
+ public void testHoming_error_oofPolicyException() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
}
@Test
- public void testHoming_error_oofServiceException() throws Exception {
+ public void testHoming_error_oofServiceException() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_success_2AR1Vnf() throws Exception {
+ public void testHoming_success_2AR1Vnf() {
mockOof(wireMockServer);
@Test
- public void testHoming_success_2AR1Vnf2Net() throws Exception {
+ public void testHoming_success_2AR1Vnf2Net() {
mockOof(wireMockServer);
@Test
- public void testHoming_success_vnfResourceList() throws Exception {
+ public void testHoming_success_vnfResourceList() {
// Create a Service Decomposition
MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4",
}
@Test
- public void testHoming_success_existingLicense() throws Exception {
+ public void testHoming_success_existingLicense() {
mockOof(wireMockServer);
}
@Test
- public void testHoming_error_inputVariable() throws Exception {
+ public void testHoming_error_inputVariable() {
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@Test
- public void testHoming_error_badResponse() throws Exception {
+ public void testHoming_error_badResponse() {
mockOof_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_error_oofNoSolution() throws Exception {
+ public void testHoming_error_oofNoSolution() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_error_oofPolicyException() throws Exception {
+ public void testHoming_error_oofPolicyException() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_error_oofServiceException() throws Exception {
+ public void testHoming_error_oofServiceException() {
mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
*/
@Test
- public void happyPath() throws IOException {
+ public void happyPath() {
logStart();
*/
@Test
- public void badGet() throws IOException {
+ public void badGet() {
logStart();
*/
@Test
- public void failValidation1() throws IOException {
+ public void failValidation1() {
logStart();
*/
@Test
- public void failValidation2() throws IOException {
+ public void failValidation2() {
logStart();
*/
@Test
- public void badPatch() throws IOException {
+ public void badPatch() {
logStart();
*/
@Test
@Deployment(resources = {"subprocess/ReceiveWorkflowMessage.bpmn"})
- public void happyPath() throws Exception {
+ public void happyPath() {
logStart();
*/
@Test
@Deployment(resources = {"subprocess/ReceiveWorkflowMessage.bpmn"})
- public void timeout() throws Exception {
+ public void timeout() {
logStart();
*/
@Test
@Ignore
- public void success() throws IOException {
+ public void success() {
logStart();
mocks();
@Test
// 1802 merge
- public void testHoming_success_2AR1Vnf() throws Exception {
+ public void testHoming_success_2AR1Vnf() {
mockSNIRO(wireMockServer);
@Test
// 1802 merge
- public void testHoming_success_2AR1Vnf2Net() throws Exception {
+ public void testHoming_success_2AR1Vnf2Net() {
mockSNIRO(wireMockServer);
@Test
// 1802 merge
- public void testHoming_success_vnfResourceList() throws Exception {
+ public void testHoming_success_vnfResourceList() {
// Create a Service Decomposition
MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4",
@Test
- public void testHoming_success_existingLicense() throws Exception {
+ public void testHoming_success_existingLicense() {
mockSNIRO(wireMockServer);
@Test
- public void testHoming_error_inputVariable() throws Exception {
+ public void testHoming_error_inputVariable() {
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@Test
- public void testHoming_error_badResponse() throws Exception {
+ public void testHoming_error_badResponse() {
mockSNIRO_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
// 1802 merge
- public void testHoming_error_sniroNoSolution() throws Exception {
+ public void testHoming_error_sniroNoSolution() {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_error_sniroPolicyException() throws Exception {
+ public void testHoming_error_sniroPolicyException() {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
@Test
- public void testHoming_error_sniroServiceException() throws Exception {
+ public void testHoming_error_sniroServiceException() {
mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutGenericVnf_Bad;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
*/
@Test
- public void happyPath() throws IOException {
+ public void happyPath() {
logStart();
String updateAAIGenericVnfRequest =
*/
@Test
- public void personaMismatch() throws IOException {
+ public void personaMismatch() {
logStart();
*/
@Test
- public void badGet() throws IOException {
+ public void badGet() {
logStart();
*/
@Test
- public void badPatch() throws IOException {
+ public void badPatch() {
logStart();
import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
*/
@Test
- public void happyPath() throws IOException {
+ public void happyPath() {
logStart();
String updateAAIVfModuleRequest =
*/
@Test
- public void badGet() throws IOException {
+ public void badGet() {
logStart();
*/
@Test
- public void badPatch() throws IOException {
+ public void badPatch() {
logStart();
@Test
- public void testCreateVfModuleSuccess() throws Exception {
+ public void testCreateVfModuleSuccess() {
logStart();
mockVNFPost(wireMockServer, "", 202, "vnfId");
@Test
- public void testUpdateVfModuleSuccess() throws Exception {
+ public void testUpdateVfModuleSuccess() {
logStart();
mockVNFPut(wireMockServer, "/vfModuleId", 202);
@Test
- public void testDeleteVfModuleSuccess() throws Exception {
+ public void testDeleteVfModuleSuccess() {
logStart();
mockVNFDelete(wireMockServer, "vnfId", "/vfModuleId", 202);
@Test
- public void testRollbackVfModuleSuccess() throws Exception {
+ public void testRollbackVfModuleSuccess() {
logStart();
mockVNFRollbackDelete(wireMockServer, "/vfModuleId", 202);
@Test
- public void testCreateVfModuleException() throws Exception {
+ public void testCreateVfModuleException() {
logStart();
mockVNFPost(wireMockServer, "", 202, "vnfId");
assertEquals(200, workflowResponse.getMessageCode());
}
- private void executeWorkflow(String request, String requestId, String processKey) throws InterruptedException {
+ private void executeWorkflow(String request, String requestId, String processKey) {
WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
VariableMapImpl variableMap = new VariableMapImpl();
@Test
@Deployment(resources = {"testAsyncResource.bpmn"})
- public void asyncRequestSuccess() throws InterruptedException {
+ public void asyncRequestSuccess() {
VariableMapImpl variableMap = new VariableMapImpl();
Map<String, Object> variableValueType = new HashMap<>();
}
@Test
- public void testCreateVcpeResCustService_Success() throws Exception {
+ public void testCreateVcpeResCustService_Success() {
System.out.println("starting: testCreateVcpeResCustService_Success\n");
MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2",
"VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
}
@Test
- public void testCreateVcpeResCustService_NoParts() throws Exception {
+ public void testCreateVcpeResCustService_NoParts() {
System.out.println("starting: testCreateVcpeResCustService_NoParts\n");
MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2",
"VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
}
@Test
- public void testCreateVcpeResCustService_Fault_NoRollback() throws Exception {
+ public void testCreateVcpeResCustService_Fault_NoRollback() {
System.out.println("starting: testCreateVcpeResCustService_Fault_NoRollback\n");
MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2",
"VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
}
@Test
- public void testCreateVcpeResCustService_Fault_Rollback() throws Exception {
+ public void testCreateVcpeResCustService_Fault_Rollback() {
System.out.println("starting: testCreateVcpeResCustService_Fault_Rollback\n");
MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2",
"VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
import static org.onap.so.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
import static org.onap.so.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
logEnd();
}
- private Map<String, Object> setupVariables(String requestId) throws UnsupportedEncodingException {
+ private Map<String, Object> setupVariables(String requestId) {
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled", "true");
variables.put("requestId", requestId);
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
@Test
- public void sunnyDayAAICheckVnfInMaintBBTest() throws InterruptedException, IOException {
+ public void sunnyDayAAICheckVnfInMaintBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAICheckVnfInMaintBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_AAICheckVnfInMaintBB", "Task_CheckVnfInMaint",
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
-import java.io.IOException;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
public class AAISetPNFInMaintBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAAISetPnfInMaintBBTest() throws InterruptedException, IOException {
+ public void sunnyDayAAISetPnfInMaintBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAISetPnfInMaintBB", variables);
assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_AAISetPnfInMaintBB", "Task_SetInMaint",
"End_AAISetPnfInMaintBB");
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
@Test
- public void sunnyDayAAISetVnfInMaintBBTest() throws InterruptedException, IOException {
+ public void sunnyDayAAISetVnfInMaintBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAISetVnfInMaintBB", variables);
assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_AAISetVnfInMaintBB", "Task_SetInMaint",
"End_AAISetVnfInMaintBB");
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
@Test
- public void sunnyDayAAISetVnftInMaintBBTest() throws InterruptedException, IOException {
+ public void sunnyDayAAISetVnftInMaintBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAIUnsetVnfInMaintBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_AAIUnsetVnfInMaintBB", "Task_UnsetInMaint",
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
@Test
- public void sunnyDaySDNOHealthCheckTest() throws InterruptedException, IOException {
+ public void sunnyDaySDNOHealthCheckTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("SDNOVnfHealthCheckBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_SDNOHealthCheckBB", "Task_SDNOHealthCheck",
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.camunda.bpm.engine.delegate.BpmnError;
public class WorkflowActionBBTest extends BaseBPMNTest {
@Test
- public void sunnyDaySuccessIsTopLevelFlow() throws InterruptedException, IOException {
+ public void sunnyDaySuccessIsTopLevelFlow() {
variables.put("isTopLevelFlow", true);
variables.put("completed", true);
}
@Test
- public void sunnyDaySuccessNotTopLevelFlow() throws InterruptedException, IOException {
+ public void sunnyDaySuccessNotTopLevelFlow() {
variables.put("isTopLevelFlow", false);
variables.put("completed", true);
}
@Test
- public void sunnyDayRollback() throws InterruptedException, IOException {
+ public void sunnyDayRollback() {
variables.put("isTopLevelFlow", false);
variables.put("isRollbackNeeded", false);
}
@Test
- public void rainyDayAbort() throws Exception {
+ public void rainyDayAbort() {
variables.put("isTopLevelFlow", true);
variables.put("completed", false);
}
@Test
- public void errorCatchBpmnSubprocessHandlingTest() throws Exception {
+ public void errorCatchBpmnSubprocessHandlingTest() {
variables.put("isTopLevelFlow", true);
variables.put("sentSyncResponse", false);
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBTasks)
public class ActivateNetworkBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayActivateNetwork_Test() throws InterruptedException {
+ public void sunnyDayActivateNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayActivateNetwork_Test() throws Exception {
+ public void rainyDayActivateNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusActiveNetwork(any(BuildingBlockExecution.class));
public class ActivateNetworkCollectionBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayActivateNetworkCollection_Test() throws InterruptedException {
+ public void sunnyDayActivateNetworkCollection_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("activateNetworkCollection_startEvent",
@Test
- public void rainyDayActivateNetworkCollection_Test() throws Exception {
+ public void rainyDayActivateNetworkCollection_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusActiveNetworkCollection(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB", variables);
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
-import java.io.IOException;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
public class ActivateServiceInstanceBBTest extends BaseBPMNTest {
@Test
- public void sunnyDaySDNC() throws InterruptedException, IOException {
+ public void sunnyDaySDNC() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateServiceInstanceBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_ActivateServiceInstanceBB", "Task_NoOpServiceInstance",
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Before;
}
@Test
- public void sunnyDay() throws InterruptedException, IOException {
+ public void sunnyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables);
}
@Test
- public void rainyDay() throws Exception {
+ public void rainyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(BpmnError.class).when(aaiUpdateTasks)
.updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class));
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
-import java.io.IOException;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
public class ActivateVnfBBTest extends BaseBPMNTest {
@Test
- public void sunnyDay() throws InterruptedException, IOException {
+ public void sunnyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVnfBB", variables);
assertThat(pi).isNotNull();
public class ActivateVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayAssignVolumeGroup_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("ActivateVolumeGroupBB_Start", "ActivateVolumeGroup",
}
@Test
- public void rainyDayAssignVolumeGroup_Test() throws Exception {
+ public void rainyDayAssignVolumeGroup_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusActiveVolumeGroup(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables);
public class AssignNetworkBBTest extends BaseBPMNTest {
@Test
@Deployment(resources = {"subprocess/AssignNetworkRollbackBB.bpmn"})
- public void sunnyDayAssignNetwork_Test() throws InterruptedException {
+ public void sunnyDayAssignNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignNetworkBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayAssignNetwork_Test() throws Exception {
+ public void rainyDayAssignNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusAssignedNetwork(any(BuildingBlockExecution.class));
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
-import java.io.IOException;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
public class AssignServiceInstanceBBTest extends BaseBPMNTest {
@Test
- public void sunnyDaySDNC() throws InterruptedException, IOException {
+ public void sunnyDaySDNC() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignServiceInstanceBB", variables);
assertThat(pi).isNotNull();
public class AssignVfModuleBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignVfModule_Test() throws InterruptedException {
+ public void sunnyDayAssignVfModule_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayAssignVfModule_Test() throws Exception {
+ public void rainyDayAssignVfModule_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks)
.createVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables);
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class AssignVnfBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignVnfBBTest() throws InterruptedException, IOException {
+ public void sunnyDayAssignVnfBBTest() {
variables.put("homing", true);
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables);
}
@Test
- public void rainyDayAssignVnfBBTest() throws Exception {
+ public void rainyDayAssignVnfBBTest() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks)
.createVnf(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables);
public class AssignVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayAssignVolumeGroup_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("AssignVolumeGroupBB_Start", "AssignVolumeGroup",
}
@Test
- public void rainyDayAssignVolumeGroup_Test() throws Exception {
+ public void rainyDayAssignVolumeGroup_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks)
.createVolumeGroup(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables);
public class BuildingBlockValidatorRunnerTest extends BaseBPMNTest {
@Test
- public void sunnyDayActivateNetwork_Test() throws InterruptedException {
+ public void sunnyDayActivateNetwork_Test() {
variables.put("flowToBeCalled", "CreateVolumeGroupBB");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("BuildingBlockValidatorRunnerTest", variables);
assertThat(pi).isNotNull();
public class ChangeModelVfModuleBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayChangeModelVfModuleTest() throws InterruptedException {
+ public void sunnyDayChangeModelVfModuleTest() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ChangeModelVfModuleBB", variables);
assertThat(pi).isNotNull();
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class ConfigurationScaleOutBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayConfigurationScaleOutBBTest() throws InterruptedException, IOException {
+ public void sunnyDayConfigurationScaleOutBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule",
public class CreateCustomerBBTest extends BaseBPMNTest {
@Test
- public void createCustomerBBTest() throws InterruptedException {
+ public void createCustomerBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateCustomerBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("CreateCustomerBB_Start", "CreateCustomerAAI",
public class CreateNetworkBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayCreateNetwork_Test() throws InterruptedException {
+ public void sunnyDayCreateNetwork_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkBB", variables);
assertThat(pi).isNotNull();
public class CreateNetworkCollectionBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayCreateNetworkCollection_Test() throws InterruptedException {
+ public void sunnyDayCreateNetworkCollection_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask",
}
@Test
- public void rainyDayCreateNetworkCollection_Test() throws Exception {
+ public void rainyDayCreateNetworkCollection_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks)
.createNetworkCollectionInstanceGroup(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables);
public class CreateVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayCreateVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayCreateVolumeGroup_Test() {
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayCreateVolumeGroup_Test() throws Exception {
+ public void rainyDayCreateVolumeGroup_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks)
.createVolumeGroupRequest(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables);
}
@Test
- public void rainyDayCreateVolumeGroupUpdateHeatStackIdError_Test() throws Exception {
+ public void rainyDayCreateVolumeGroupUpdateHeatStackIdError_Test() {
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateHeatStackIdVolumeGroup(any(BuildingBlockExecution.class));
public class DeactivateNetworkBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayDeactivateNetworkBB_Test() throws InterruptedException {
+ public void sunnyDayDeactivateNetworkBB_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateNetworkBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayDeactivateNetworkBB_Test() throws Exception {
+ public void rainyDayDeactivateNetworkBB_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncDeactivateTasks)
.deactivateNetwork(any(BuildingBlockExecution.class));
*/
public class DeactivateServiceInstanceBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayDeactivateServiceInstanceSDNC() throws InterruptedException {
+ public void sunnyDayDeactivateServiceInstanceSDNC() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateServiceInstanceBB", variables);
assertThat(pi).isNotNull();
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class DeactivateVfModuleBBTest extends BaseBPMNTest {
@Test
- public void sunnyDay() throws InterruptedException, IOException {
+ public void sunnyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVfModuleBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDay() throws Exception {
+ public void rainyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(BpmnError.class).when(aaiUpdateTasks)
.updateOrchestrationStatusDeactivateVfModule(any(BuildingBlockExecution.class));
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class DeactivateVnfBBTest extends BaseBPMNTest {
@Test
- public void sunnyDay() throws InterruptedException, IOException {
+ public void sunnyDay() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayDeactivateVnfAAIError_Test() throws Exception {
+ public void rainyDayDeactivateVnfAAIError_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusAssignedVnf(any(BuildingBlockExecution.class));
public class DeactivateVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayAssignVolumeGroup_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("DeactivateVolumeGroupBB_Start", "DeactivateVolumeGroup",
}
@Test
- public void rainyDayAssignVolumeGroup_Test() throws Exception {
+ public void rainyDayAssignVolumeGroup_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusCreatedVolumeGroup(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables);
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class DeleteInstanceGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDay() throws InterruptedException, IOException {
+ public void sunnyDay() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming",
public class DeleteNetworkBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayDeleteNetwork_Test() throws InterruptedException {
+ public void sunnyDayDeleteNetwork_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("deleteNetwork_startEvent", "deleteNetworkAIC", "updateNetworkAAI",
}
@Test
- public void rainyDayDeleteNetwork_Test() throws Exception {
+ public void rainyDayDeleteNetwork_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(networkAdapterDeleteTasks)
.deleteNetwork(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB", variables);
public class DeleteNetworkCollectionBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayCreateNetworkCollection_Test() throws InterruptedException {
+ public void sunnyDayCreateNetworkCollection_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkCollectionBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("deleteNetworkCollection_startEvent",
public class DeleteVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayDeleteVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayDeleteVolumeGroup_Test() {
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVolumeGroupBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayDeleteVolumeGroup_Test() throws Exception {
+ public void rainyDayDeleteVolumeGroup_Test() {
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks)
.updateOrchestrationStatusAssignedVolumeGroup(any(BuildingBlockExecution.class));
public class DistributeTrafficActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayDistributeTrafficActivity_Test() throws InterruptedException {
+ public void sunnyDayDistributeTrafficActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskDistributeTraffic");
}
@Test
- public void rainyDayDistributeTrafficActivity_Test() throws Exception {
+ public void rainyDayDistributeTrafficActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables);
public class DistributeTrafficCheckActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayDistributeTrafficCheckActivity_Test() throws InterruptedException {
+ public void sunnyDayDistributeTrafficCheckActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskDistributeTrafficCheck");
}
@Test
- public void rainyDayDistributeTrafficActivity_Test() throws Exception {
+ public void rainyDayDistributeTrafficActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables);
}
@Test
- public void test_sunnyDayExecuteBuildingBlock_silentSuccess() throws Exception {
+ public void test_sunnyDayExecuteBuildingBlock_silentSuccess() {
variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
variables.put("homing", false);
public class FlowCompleteActivity extends BaseBPMNTest {
@Test
- public void sunnyDayFlowCompleteActivity_Test() throws InterruptedException {
+ public void sunnyDayFlowCompleteActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("FlowCompleteActivity_Start", "TaskUpdateRequestDB",
}
@Test
- public void rainyDayFlowCompleteActivity_Test() throws Exception {
+ public void rainyDayFlowCompleteActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(flowCompletionTasks)
.updateRequestDbStatus(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables);
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
public class GenericVnfHealthCheckBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayGenericVnfHealthCheckBBTest() throws InterruptedException, IOException {
+ public void sunnyDayGenericVnfHealthCheckBBTest() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void genericVnfHealthCheckBBExceptionTest() throws Exception {
+ public void genericVnfHealthCheckBBExceptionTest() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(genericVnfHealthCheck)
.setParamsForGenericVnfHealthCheck(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables);
protected TaskService taskService;
@Test
- public void sunnyDayPauseForManualTaskTimeout_Test() throws InterruptedException {
+ public void sunnyDayPauseForManualTaskTimeout_Test() {
variables.put("taskTimeout", TIMEOUT_10_S);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables);
assertThat(pi).isNotNull();
}
@Test
- public void sunnyDayPauseForManualTaskCompleted_Test() throws InterruptedException {
+ public void sunnyDayPauseForManualTaskCompleted_Test() {
variables.put("taskTimeout", TIMEOUT_10_S);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayPauseForManualTask_Test() throws Exception {
+ public void rainyDayPauseForManualTask_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(manualHandlingTasks)
.createExternalTicket((any(BuildingBlockExecution.class)));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables);
protected TaskService taskService;
@Test
- public void sunnyDayPauseForManualTaskRainyDayTimeout_Test() throws InterruptedException {
+ public void sunnyDayPauseForManualTaskRainyDayTimeout_Test() {
variables.put("taskTimeout", TIMEOUT_10_S);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskRainyDay", variables);
assertThat(pi).isNotNull();
}
@Test
- public void sunnyDayPauseForManualTaskCompleted_Test() throws InterruptedException {
+ public void sunnyDayPauseForManualTaskCompleted_Test() {
variables.put("taskTimeout", TIMEOUT_10_S);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskRainyDay", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayPauseForManualTask_Test() throws Exception {
+ public void rainyDayPauseForManualTask_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(manualHandlingTasks)
.createExternalTicket((any(BuildingBlockExecution.class)));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskRainyDay", variables);
public class SDNCHandlerTest extends BaseBPMNTest {
@Test
- public void sunnyDay_SDNCHandler_Sync_Final_Test()
- throws InterruptedException, MapperException, BadResponseException, IOException {
+ public void sunnyDay_SDNCHandler_Sync_Final_Test() throws MapperException, BadResponseException, IOException {
final String sdncResponse =
new String(Files.readAllBytes(Paths.get("src/test/resources/SDNCClientPut200Response.json")));
doReturn(sdncResponse).when(sdncClient).post(createSDNCRequest().getSDNCPayload(), SDNCTopology.CONFIGURATION);
public class UnassignNetworkBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayAssignNetwork_Test() throws InterruptedException {
+ public void sunnyDayAssignNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetworkBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayAssignNetwork_Test() throws Exception {
+ public void rainyDayAssignNetwork_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignNetworkBB)
.checkRelationshipRelatedTo(any(BuildingBlockExecution.class), eq("vf-module"));
public class UnassignServiceInstanceBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayUnassignServiceInstanceSDNC() throws InterruptedException {
+ public void sunnyDayUnassignServiceInstanceSDNC() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
BuildingBlockExecution bbe = new DelegateExecutionImpl(new ExecutionImpl());
variables.put("gBuildingBlockExecution", bbe);
public class UnassignVfModuleBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayUnassignVfModule_Test() throws InterruptedException {
+ public void sunnyDayUnassignVfModule_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayUnassignVfModuleSDNCUnassignFailed_Test() throws Exception {
+ public void rainyDayUnassignVfModuleSDNCUnassignFailed_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks)
.unassignVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables);
public class UnassignVnfBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayUnassignVnf_Test() throws InterruptedException {
+ public void sunnyDayUnassignVnf_Test() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables);
assertThat(pi).isNotNull();
@Test
@Ignore
- public void rainyDayUnassignVnfInstanceGroupsDeleteFailed_Test() throws Exception {
+ public void rainyDayUnassignVnfInstanceGroupsDeleteFailed_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignVnf)
.deleteInstanceGroups(any(BuildingBlockExecution.class)); // .deleteVnf(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables);
}
@Test
- public void rainyDayUnassignVnfSDNCUnassignFailed_Test() throws Exception {
+ public void rainyDayUnassignVnfSDNCUnassignFailed_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks)
.unassignVnf(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables);
public class UnassignVolumeGroupBBTest extends BaseBPMNTest {
@Test
- public void sunnyDayUnassignVolumeGroup_Test() throws InterruptedException {
+ public void sunnyDayUnassignVolumeGroup_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("UnassignVolumeGroupBB_Start", "UnassignVolumeGroup",
}
@Test
- public void rainyDayUnassignVolumeGroup_Test() throws InterruptedException {
+ public void rainyDayUnassignVolumeGroup_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks)
.deleteVolumeGroup(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables);
public class UpdateNetworkBBTest extends BaseBPMNTest {
@Test
- public void updateNetworkBBTest() throws InterruptedException {
+ public void updateNetworkBBTest() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("UpdateNetworkBB", variables);
assertThat(processInstance).isNotNull();
}
@Test
- public void updateNetworkBBExceptionTest() throws Exception {
+ public void updateNetworkBBExceptionTest() {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiQueryTasks)
.queryNetworkVpnBinding(any(BuildingBlockExecution.class));
public class VNFCheckClosedLoopDisabledFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFCheckClosedLoopDisabledFlagActivity_Test() {
ProcessInstance pi =
runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws Exception {
+ public void rainyDayVNFCheckClosedLoopDisabledFlagActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.checkVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class));
ProcessInstance pi =
public class VNFCheckInMaintFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFCheckInMaintFlagActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", "TaskCheckInMaintFlag",
}
@Test
- public void rainyDayVNFCheckInMaintFlagActivity_Test() throws Exception {
+ public void rainyDayVNFCheckInMaintFlagActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.checkVnfInMaintFlag(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables);
public class VNFCheckPserversLockedFlagActivity extends BaseBPMNTest {
@Test
- public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFCheckInMaintFlagActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start",
}
@Test
- public void rainyDayVNFCheckPserversLockedFlagActivity_Test() throws Exception {
+ public void rainyDayVNFCheckPserversLockedFlagActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.checkVnfPserversLockedFlag(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables);
public class VNFConfigModifyActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFConfigModifyActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFConfigModifyActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "ConfigModify");
}
@Test
- public void rainyDayVNFConfigModifyActivity_Test() throws Exception {
+ public void rainyDayVNFConfigModifyActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables);
public class VNFHealthCheckActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFHealthCheckActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskHealthCheck");
}
@Test
- public void rainyDayVNFHealthCheckActivity_Test() throws Exception {
+ public void rainyDayVNFHealthCheckActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
public class VNFLockActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFLockActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFLockActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskLock");
}
@Test
- public void rainyDayVNFLockActivity_Test() throws Exception {
+ public void rainyDayVNFLockActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFQuiesceTrafficActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskQuiesceTraffic");
}
@Test
- public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception {
+ public void rainyDayVNFQuiesceTrafficActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
public class VNFResumeTrafficActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFResumeTrafficActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskResumeTraffic");
}
@Test
- public void rainyDayVNFResumeTrafficActivity_Test() throws Exception {
+ public void rainyDayVNFResumeTrafficActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
public class VNFSetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFSetClosedLoopDisabledFlagActivity_Test() {
ProcessInstance pi =
runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws Exception {
+ public void rainyDayVNFSetClosedLoopDisabledFlagActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class));
ProcessInstance pi =
public class VNFSetInMaintFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFSetInMaintFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFSetInMaintFlagActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start", "TaskSetInMaint",
}
@Test
- public void rainyDayVNFSetInMaintFlagActivity_Test() throws Exception {
+ public void rainyDayVNFSetInMaintFlagActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables);
public class VNFSnapShotActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFSnapShotActivity_Test() {
variables.put("vmIdListSize", 0);
variables.put("vmIdList", null);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
}
@Test
- public void rainyDayVNFSnapShotActivity_Test() throws Exception {
+ public void rainyDayVNFSnapShotActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
public class VNFStartActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFStartActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFStartActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskStart");
}
@Test
- public void rainyDayVNFStartActivity_Test() throws Exception {
+ public void rainyDayVNFStartActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
public class VNFStopActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFStopActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFStopActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskStop");
}
@Test
- public void rainyDayVNFStopActivity_Test() throws Exception {
+ public void rainyDayVNFStopActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
public class VNFUnlockActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUnlockActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskUnlock");
}
@Test
- public void rainyDayVNFUnlockActivity_Test() throws Exception {
+ public void rainyDayVNFUnlockActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
public class VNFUnsetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUnsetClosedLoopDisabledFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUnsetClosedLoopDisabledFlagActivity_Test() {
ProcessInstance pi =
runtimeService.startProcessInstanceByKey("VNFUnsetClosedLoopDisabledFlagActivity", variables);
assertThat(pi).isNotNull();
}
@Test
- public void rainyDayVNFUnsetClosedLoopFlag_Test() throws Exception {
+ public void rainyDayVNFUnsetClosedLoopFlag_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class));
ProcessInstance pi =
public class VNFUnsetInMaintFlagActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUnsetInMaintFlagActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUnsetInMaintFlagActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start", "TaskUnsetInMaint",
}
@Test
- public void rainyDayVNFUnsetInMaintFlag_Test() throws Exception {
+ public void rainyDayVNFUnsetInMaintFlag_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
.modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables);
public class VNFUpgradeBackupActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUpgradeBackupActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskUpgradeBackup");
}
@Test
- public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception {
+ public void rainyDayVNFUpgradeBackupActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUpgradePostCheckActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
processExternalTasks(pi, "TaskUpgradePostCheck");
assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start",
}
@Test
- public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception {
+ public void rainyDayVNFUpgradePostCheckActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUpgradePreCheckActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskUpgradePreCheck");
}
@Test
- public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception {
+ public void rainyDayVNFUpgradePreCheckActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest {
@Test
- public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException {
+ public void sunnyDayVNFUpgradeSoftwareActivity_Test() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
assertThat(pi).isNotNull();
processExternalTasks(pi, "TaskUpgradeSoftware");
}
@Test
- public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception {
+ public void rainyDayVNFUpgradeSoftwareActivity_Test() {
doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
.buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
class KafkaTopicListenerThread implements Runnable {
@Override
public void run() {
- try {
- List<String> response;
- System.out.println(pnfUpdateTopic + " " + consumerGroup);
- response = consumerForPnfUpdate.get(pnfUpdateTopic, consumerGroup, consumerIdUpdate);
- if (response.isEmpty()) {
- response = consumerForPnfReady.get(pnfReadyTopic, consumerGroup, consumerId);
- getPnfCorrelationIdListFromResponse(response)
- .forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
- } else {
- getPnfCorrelationIdListFromResponse(response)
- .forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
- }
- } catch (IOException e) {
- logger.error("Exception caught during sending rest request to kafka for listening event topic", e);
+ List<String> response;
+ System.out.println(pnfUpdateTopic + " " + consumerGroup);
+ response = consumerForPnfUpdate.get(pnfUpdateTopic, consumerGroup, consumerIdUpdate);
+ if (response.isEmpty()) {
+ response = consumerForPnfReady.get(pnfReadyTopic, consumerGroup, consumerId);
+ getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
+ } else {
+ getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
}
}
- private List<String> getPnfCorrelationIdListFromResponse(List<String> response) throws IOException {
+ private List<String> getPnfCorrelationIdListFromResponse(List<String> response) {
if (response != null) {
return JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(response);
}
}
}
}
-
.setWorkloadContext("workloadContext").createAAIServiceInstance();
@Test
- public void getServiceInstanceNameTest() throws Exception {
+ public void getServiceInstanceNameTest() {
test.getServiceInstanceName();
}
@Test
- public void setServiceInstanceNameTest() throws Exception {
+ public void setServiceInstanceNameTest() {
test.setServiceInstanceName("serviceInstanceName");
}
@Test
- public void getServiceTypeTest() throws Exception {
+ public void getServiceTypeTest() {
test.getServiceType();
}
@Test
- public void setServiceTypeTest() throws Exception {
+ public void setServiceTypeTest() {
test.setServiceType("serviceType");
}
@Test
- public void getServiceRoleTest() throws Exception {
+ public void getServiceRoleTest() {
test.getServiceRole();
}
@Test
- public void setServiceRoleTest() throws Exception {
+ public void setServiceRoleTest() {
test.setServiceRole("serviceRole");
}
@Test
- public void getOrchestrationStatusTest() throws Exception {
+ public void getOrchestrationStatusTest() {
test.getOrchestrationStatus();
}
@Test
- public void setOrchestrationStatusTest() throws Exception {
+ public void setOrchestrationStatusTest() {
test.setOrchestrationStatus("status");
}
@Test
- public void getModelInvariantUuidTest() throws Exception {
+ public void getModelInvariantUuidTest() {
test.getModelInvariantUuid();
}
@Test
- public void setModelInvariantUuidTest() throws Exception {
+ public void setModelInvariantUuidTest() {
test.setModelInvariantUuid("uuid");
}
@Test
- public void getModelVersionIdTest() throws Exception {
+ public void getModelVersionIdTest() {
test.getModelVersionId();
}
@Test
- public void setModelVersionIdTest() throws Exception {
+ public void setModelVersionIdTest() {
test.setModelVersionId("versionId");
}
@Test
- public void getEnvironmentContextTest() throws Exception {
+ public void getEnvironmentContextTest() {
test.getEnvironmentContext();
}
@Test
- public void setEnvironmentContextTest() throws Exception {
+ public void setEnvironmentContextTest() {
test.setEnvironmentContext("context");
}
@Test
- public void getWorkloadContextTest() throws Exception {
+ public void getWorkloadContextTest() {
test.getWorkloadContext();
}
@Test
- public void setWorkloadContextTest() throws Exception {
+ public void setWorkloadContextTest() {
test.setWorkloadContext("context");
}
public void before() {}
@Test
- public void generateInstanceGroupNameTest() throws Exception {
+ public void generateInstanceGroupNameTest() {
ModelInfoInstanceGroup modelVnfc = new ModelInfoInstanceGroup();
modelVnfc.setFunction("vre");
}
@Test
- public void shouldThrowExceptionWhenPnfCorrelationIdIsNotSet() throws Exception {
+ public void shouldThrowExceptionWhenPnfCorrelationIdIsNotSet() {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(null);
}
@Test
- public void shouldSetCorrectVariablesWhenAaiDoesNotContainInfoAboutPnf() throws Exception {
+ public void shouldSetCorrectVariablesWhenAaiDoesNotContainInfoAboutPnf() {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITHOUT_ENTRY);
}
@Test
- public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithoutIp() throws Exception {
+ public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithoutIp() {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
}
@Test
- public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() throws Exception {
+ public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(PNF_CORRELATION_ID)).thenReturn(ID_WITH_ENTRY);
* and shutdown the executor because of empty map
*/
@Test
- public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfUpdate() throws IOException {
+ public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfUpdate() {
when(kafkaConsumerMock.get(any(String.class), any(String.class), any(String.class)))
.thenReturn(Arrays.asList(String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[0], PNF_CORRELATION_ID),
JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[1]));
@Test
- public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfReady() throws IOException {
+ public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfReady() {
when(kafkaConsumerMock.get(any(String.class), any(String.class), any(String.class)))
.thenReturn(Collections.emptyList())
.thenReturn(Arrays.asList(String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[0], PNF_CORRELATION_ID),
* response. run method should not do anything with the map not run any thread to notify camunda process
*/
@Test
- public void pnfCorrelationIdIsFoundInHttpResponse_NotFoundInMap() throws IOException {
+ public void pnfCorrelationIdIsFoundInHttpResponse_NotFoundInMap() {
when(kafkaConsumerMock.get(any(String.class), any(String.class), any(String.class))).thenReturn(Arrays.asList(
String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[0], PNF_CORRELATION_ID_NOT_FOUND_IN_MAP),
JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[1]));
* method should not do anything with the map and not run any thread to notify camunda process
*/
@Test
- public void pnfCorrelationIdIsNotFoundInHttpResponse() throws IOException {
+ public void pnfCorrelationIdIsNotFoundInHttpResponse() {
when(kafkaConsumerMock.get(any(String.class), any(String.class), any(String.class)))
.thenReturn(Arrays.asList(JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID));
testedObjectInnerClassThread.run();
public class HeaderUtilTest {
@Test
- public void getAuthorizationTest() throws Exception {
+ public void getAuthorizationTest() {
String authorization = HeaderUtil.getAuthorization(HeaderUtil.USER, HeaderUtil.PASS);
assertEquals("Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==", authorization);
}
}
@Test
- public void getRequestActionBlankOperationTypeTest() throws Exception {
+ public void getRequestActionBlankOperationTypeTest() {
assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(),
abstractBuilder.getRequestAction(delegateExecution));
}
@Test
- public void getRequestActionDeleteOperationTypeBlankResourceTypeTest() throws Exception {
+ public void getRequestActionDeleteOperationTypeBlankResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
}
@Test
- public void getRequestActionDeleteOperationTypeBadResourceTypeTest() throws Exception {
+ public void getRequestActionDeleteOperationTypeBadResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
}
@Test
- public void getRequestActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception {
+ public void getRequestActionDeleteOperationTypeOverlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
assertEquals(AbstractBuilder.RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName(),
}
@Test
- public void getRequestActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception {
+ public void getRequestActionDeleteOperationTypeUnderlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
assertEquals(AbstractBuilder.RequestAction.DELETE_NETWORK_INSTANCE.getName(),
}
@Test
- public void getRequestActionDeleteOperationTypeTest() throws Exception {
+ public void getRequestActionDeleteOperationTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
abstractBuilder.getRequestAction(delegateExecution));
}
@Test
- public void getRequestActionCreateOperationTypeBlankResourceTypeTest() throws Exception {
+ public void getRequestActionCreateOperationTypeBlankResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
}
@Test
- public void getRequestActionCreateOperationTypeBadResourceTypeTest() throws Exception {
+ public void getRequestActionCreateOperationTypeBadResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
}
@Test
- public void getRequestActionCreateOperationTypeOverlayResourceTypeTest() throws Exception {
+ public void getRequestActionCreateOperationTypeOverlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
assertEquals(AbstractBuilder.RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName(),
}
@Test
- public void getRequestActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception {
+ public void getRequestActionCreateOperationTypeUnderlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(),
}
@Test
- public void getRequestActionCreateOperationTypeTest() throws Exception {
+ public void getRequestActionCreateOperationTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
abstractBuilder.getRequestAction(delegateExecution));
}
@Test
- public void getSvcActionBlankOperationTypeTest() throws Exception {
+ public void getSvcActionBlankOperationTypeTest() {
assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionDeleteOperationTypeBlankResourceTypeTest() throws Exception {
+ public void getSvcActionDeleteOperationTypeBlankResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionDeleteOperationTypeBadResourceTypeTest() throws Exception {
+ public void getSvcActionDeleteOperationTypeBadResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception {
+ public void getSvcActionDeleteOperationTypeOverlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
assertEquals(AbstractBuilder.SvcAction.DEACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception {
+ public void getSvcActionDeleteOperationTypeUnderlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
assertEquals(AbstractBuilder.SvcAction.DELETE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionDeleteOperationTypeTest() throws Exception {
+ public void getSvcActionDeleteOperationTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionCreateOperationTypeBlankResourceTypeTest() throws Exception {
+ public void getSvcActionCreateOperationTypeBlankResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionCreateOperationTypeBadResourceTypeTest() throws Exception {
+ public void getSvcActionCreateOperationTypeBadResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionCreateOperationTypeOverlayResourceTypeTest() throws Exception {
+ public void getSvcActionCreateOperationTypeOverlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
assertEquals(AbstractBuilder.SvcAction.ACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception {
+ public void getSvcActionCreateOperationTypeUnderlayResourceTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
- public void getSvcActionCreateOperationTypeTest() throws Exception {
+ public void getSvcActionCreateOperationTypeTest() {
delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
}
@Test
- public void getOnapServiceModelInformationEntityTest() throws Exception {
+ public void getOnapServiceModelInformationEntityTest() {
abstractBuilder.getOnapServiceModelInformationEntity(delegateExecution);
}
@Test
- public void getOnapNetworkModelInformationEntityTest() throws Exception {
+ public void getOnapNetworkModelInformationEntityTest() {
abstractBuilder.getOnapNetworkModelInformationEntity(delegateExecution);
}
@Test
- public void getParamEntitiesTest() throws Exception {
+ public void getParamEntitiesTest() {
Map<String, String> inputs = new HashMap<>();
inputs.put("foo", "bar");
List<ParamEntity> list = abstractBuilder.getParamEntities(inputs);
}
@Test
- public void getRequestInformationEntityTest() throws Exception {
+ public void getRequestInformationEntityTest() {
abstractBuilder.getRequestInformationEntity(delegateExecution);
}
@Test
- public void getServiceInformationEntityTest() throws Exception {
+ public void getServiceInformationEntityTest() {
abstractBuilder.getServiceInformationEntity(delegateExecution);
}
@Test
- public void getServiceInstanceNameTest() throws Exception {
+ public void getServiceInstanceNameTest() {
abstractBuilder.getServiceInstanceName(delegateExecution);
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
private GrpcNettyServer grpcNettyServer;
@Before
- public void setUp() throws IOException {
+ public void setUp() {
requestObject = FileUtil.readResourceFile("request/" + getClass().getSimpleName() + ".json");
responseObject = FileUtil.readResourceFile("response/" + getClass().getSimpleName() + ".json");
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
private GrpcNettyServer grpcNettyServer;
@Before
- public void setUp() throws IOException {
+ public void setUp() {
actionNames[0] = "preCheck";
actionNames[1] = "downloadNESw";
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
private GrpcNettyServer grpcNettyServer;
@Before
- public void setUp() throws IOException {
+ public void setUp() {
actionNames[0] = "preCheck";
actionNames[1] = "downloadNESw";
actionNames[2] = "activateNESw";
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
private GrpcNettyServer grpcNettyServer;
@Before
- public void setUp() throws IOException {
+ public void setUp() {
actionNames[0] = "healthCheck";
actionNames[1] = "healthCheck";
actionNames[2] = "preCheck";
- private String mapUserParamsToSliceProfile(List<Map<String, Object>> sliceProfilesData)
- throws JsonProcessingException {
+ private String mapUserParamsToSliceProfile(List<Map<String, Object>> sliceProfilesData) {
Map<String, Object> mapParam = (Map<String, Object>) sliceProfilesData.get(0).get("nssi");
List<Object> list = (ArrayList<Object>) mapParam.get("sliceProfileList");
Map<String, Object> idMap = (Map<String, Object>) list.get(0);
return sliceProfileServiceInstanceObj;
}
- SliceProfile mapUserParamsToSliceProfile(List<Map<String, Object>> sliceProfilesData)
- throws JsonProcessingException {
+ SliceProfile mapUserParamsToSliceProfile(List<Map<String, Object>> sliceProfilesData) {
SliceProfile sliceProfile = new SliceProfile();
Map<String, Object> mapParam = (Map<String, Object>) sliceProfilesData.get(0).get("nssi");
LOGGER.info(">>> mapParam in map: {}", mapParam);
return sliceProfile;
}
- private String getSliceProfileIdFromReq(List<Map<String, Object>> sliceProfilesData)
- throws JsonProcessingException {
+ private String getSliceProfileIdFromReq(List<Map<String, Object>> sliceProfilesData) {
Map<String, Object> mapParam = (Map<String, Object>) sliceProfilesData.get(0).get("nssi");
List<Object> list = (ArrayList<Object>) mapParam.get("sliceProfileList");
DelegateExecution execution;
@Before
- public void setUp() throws Exception {}
+ public void setUp() {}
@Test
public void prepareOofRequest() {}
* @param execution
* @return
*/
- public boolean networkFoundByName(BuildingBlockExecution execution) throws Exception {
+ public boolean networkFoundByName(BuildingBlockExecution execution) {
// TODO - populate logic after iTrack MSO-2143 implemented
return false;
*
*/
- public void updateRelations(BuildingBlockExecution buildingBlockExecution) throws Exception {
+ public void updateRelations(BuildingBlockExecution buildingBlockExecution) {
Map<ResourceKey, String> lookupMap = buildingBlockExecution.getLookupMap();
private static final String INSTANCE_CREATE_PATH = "/api/cnf-adapter/v1/instance";
@Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
- public InstanceResponse createVfModule(InstanceRequest request) throws CnfAdapterClientException {
+ public InstanceResponse createVfModule(InstanceRequest request) {
try {
// String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
// for configuration
@Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
- public void deleteVfModule(String heatStackId) throws CnfAdapterClientException {
+ public void deleteVfModule(String heatStackId) {
try {
// String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
// for configuration
}
@Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
- public InstanceResponse healthcheck() throws CnfAdapterClientException {
+ public InstanceResponse healthcheck() {
try {
// String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
// for configuration
}
@Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
- public UpgradeInstanceResponse upgradeVfModule(UpgradeInstanceRequest request, String heatStackId)
- throws CnfAdapterClientException {
+ public UpgradeInstanceResponse upgradeVfModule(UpgradeInstanceRequest request, String heatStackId) {
try {
String uri = "http://so-cnf-adapter:8090";
String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH + "/" + heatStackId + "/upgrade")
}
public Map<String, Object> createVolumeGroupParams(RequestContext requestContext, GenericVnf genericVnf,
- VolumeGroup volumeGroup, String sdncVfModuleQueryResponse)
- throws JsonParseException, JsonMappingException, IOException {
+ VolumeGroup volumeGroup, String sdncVfModuleQueryResponse) throws JsonMappingException, IOException {
Map<String, Object> volumeGroupParams = new HashMap<>();
final String USER_PARAM_NAME_KEY = "name";
final String USER_PARAM_VALUE_KEY = "value";
package org.onap.so.client.adapter.vnf.mapper;
-import java.io.UnsupportedEncodingException;
import java.util.UUID;
import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.springframework.stereotype.Component;
return UUID.randomUUID().toString();
}
- public String createCallbackUrl(String messageType, String correlator) throws UnsupportedEncodingException {
+ public String createCallbackUrl(String messageType, String correlator) {
String endpoint = getProperty("mso.workflow.message.endpoint");
if (endpoint != null) {
while (endpoint.endsWith("/")) {
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Joiner;
private void buildParamsMapFromVnfSdncResponse(Map<String, Object> paramsMap,
GenericResourceApiVnftopologyVnfTopology vnfTopology, Map<String, String> networkRoleMap,
- boolean skipVnfResourceAssignments) throws IOException {
+ boolean skipVnfResourceAssignments) {
// Get VNF parameters from SDNC response
GenericResourceApiParam vnfParametersData = vnfTopology.getVnfParametersData();
buildParamsMapFromSdncParams(paramsMap, vnfParametersData);
}
private void buildParamsMapFromVfModuleSdncResponse(Map<String, Object> paramsMap,
- GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology, boolean skipVfModuleAssignments)
- throws IOException {
+ GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology, boolean skipVfModuleAssignments) {
// Get VF Module parameters from SDNC response
GenericResourceApiParam vfModuleParametersData = vfModuleTopology.getVfModuleParameters();
buildParamsMapFromSdncParams(paramsMap, vfModuleParametersData);
}
}
- private Map<String, String> buildNetworkRoleMap(GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology)
- throws JsonParseException, JsonMappingException, IOException {
+ private Map<String, String> buildNetworkRoleMap(
+ GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology) {
Map<String, String> networkRoleMap = new HashMap<>();
GenericResourceApiVfmoduleassignmentsVfModuleAssignments vfModuleAssignments =
vfModuleTopology.getVfModuleAssignments();
* 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.
package org.onap.so.client.orchestration;
-import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.Optional;
import javax.ws.rs.core.Response;
public Optional<CreateNetworkResponse> createNetwork(RequestContext requestContext, CloudRegion cloudRegion,
OrchestrationContext orchestrationContext, ServiceInstance serviceInstance, L3Network l3Network,
Map<String, String> userInput, String cloudRegionPo, Customer customer)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
CreateNetworkRequest createNetworkRequest =
networkAdapterObjectMapper.createNetworkRequestMapper(requestContext, cloudRegion, orchestrationContext,
public Optional<RollbackNetworkResponse> rollbackCreateNetwork(RequestContext requestContext,
CloudRegion cloudRegion, OrchestrationContext orchestrationContext, ServiceInstance serviceInstance,
L3Network l3Network, Map<String, String> userInput, String cloudRegionPo,
- CreateNetworkResponse createNetworkResponse)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ CreateNetworkResponse createNetworkResponse) throws NetworkAdapterClientException {
RollbackNetworkRequest rollbackNetworkRequest = null;
rollbackNetworkRequest = networkAdapterObjectMapper.createNetworkRollbackRequestMapper(requestContext,
public Optional<UpdateNetworkResponse> updateNetwork(RequestContext requestContext, CloudRegion cloudRegion,
OrchestrationContext orchestrationContext, ServiceInstance serviceInstance, L3Network l3Network,
- Map<String, String> userInput, Customer customer)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ Map<String, String> userInput, Customer customer) throws NetworkAdapterClientException {
UpdateNetworkRequest updateNetworkRequest = networkAdapterObjectMapper.createNetworkUpdateRequestMapper(
requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, customer);
}
public Optional<DeleteNetworkResponse> deleteNetwork(RequestContext requestContext, CloudRegion cloudRegion,
- ServiceInstance serviceInstance, L3Network l3Network)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ ServiceInstance serviceInstance, L3Network l3Network) throws NetworkAdapterClientException {
DeleteNetworkRequest deleteNetworkRequest = networkAdapterObjectMapper
.deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network);
}
public Optional<Response> createNetworkAsync(CreateNetworkRequest createNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
return Optional.of(networkAdapterClient.createNetworkAsync(createNetworkRequest));
}
public Optional<Response> deleteNetworkAsync(DeleteNetworkRequest deleteNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
return Optional
.of(networkAdapterClient.deleteNetworkAsync(deleteNetworkRequest.getNetworkId(), deleteNetworkRequest));
}
public Optional<Response> updateNetworkAsync(UpdateNetworkRequest updateNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
return Optional
.of(networkAdapterClient.updateNetworkAsync(updateNetworkRequest.getNetworkId(), updateNetworkRequest));
}
public Optional<RollbackNetworkResponse> rollbackCreateNetwork(String networkId,
- RollbackNetworkRequest rollbackNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ RollbackNetworkRequest rollbackNetworkRequest) throws NetworkAdapterClientException {
return Optional.of(networkAdapterClient.rollbackNetwork(networkId, rollbackNetworkRequest));
}
public Optional<UpdateNetworkResponse> updateNetwork(UpdateNetworkRequest updateNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
return Optional
.of(networkAdapterClient.updateNetwork(updateNetworkRequest.getNetworkId(), updateNetworkRequest));
}
public Optional<DeleteNetworkResponse> deleteNetwork(DeleteNetworkRequest deleteNetworkRequest)
- throws UnsupportedEncodingException, NetworkAdapterClientException {
+ throws NetworkAdapterClientException {
return Optional
.of(networkAdapterClient.deleteNetwork(deleteNetworkRequest.getNetworkId(), deleteNetworkRequest));
- public void createTicket() throws Exception {
+ public void createTicket() {
// Replace with your ticket creation mechanism if any
}
}
@Test
- public void createProjectTest() throws Exception {
+ public void createProjectTest() {
doNothing().when(aaiServiceInstanceResources)
.createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance);
aaiCreateTasks.createProject(execution);
private final BuildingBlockExecution stubbedExecution = new StubbedBuildingBlockExecution();
@Test
- public void testCreateCreateASRequest_withValidValues_storesRequestInExecution() throws Exception {
+ public void testCreateCreateASRequest_withValidValues_storesRequestInExecution() {
final CnfInstantiateTask objUnderTest = getCnfInstantiateTask();
stubbedExecution.setVariable(INPUT_PARAMETER,
}
@Test
- public void testCreateCreateASRequest_ForBBThrowsException_exceptionBuilderCalled() throws Exception {
+ public void testCreateCreateASRequest_ForBBThrowsException_exceptionBuilderCalled() {
final CnfInstantiateTask objUnderTest = getCnfInstantiateTask();
}
@Test
- public void invokeCnfmWithCreateAsRequest_validValues_storesResponseInExecution() throws Exception {
+ public void invokeCnfmWithCreateAsRequest_validValues_storesResponseInExecution() {
final CnfInstantiateTask objUnderTest = getCnfInstantiateTask();
stubbedExecution.setVariable(CREATE_AS_REQUEST_OBJECT, new CreateAsRequest());
}
@Test
- public void invokeCnfmWithCreateAsRequest_ForBBThrowsException_exceptionBuilderCalled() throws Exception {
+ public void invokeCnfmWithCreateAsRequest_ForBBThrowsException_exceptionBuilderCalled() {
final CnfInstantiateTask objUnderTest = getCnfInstantiateTask();
stubbedExecution.setVariable(CREATE_AS_REQUEST_OBJECT, new CreateAsRequest());
}
@Test
- public void testcreateAsInstanceRequest_withValidValues_storesRequestInExecution() throws Exception {
+ public void testcreateAsInstanceRequest_withValidValues_storesRequestInExecution() {
final CnfInstantiateTask objUnderTest = getCnfInstantiateTask();
}
@Test
- public void testTimeOutLogFailue() throws Exception {
+ public void testTimeOutLogFailue() {
objUnderTest.timeOutLogFailue(stubbedxecution);
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221),
eq("Node operation time out"));
private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
@Test
- public void testGetCurrentOperationStatus() throws Exception {
+ public void testGetCurrentOperationStatus() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.CREATE_VNF_RESPONSE_PARAM_NAME, getCreateVnfResponse());
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
}
@Test
- public void testGetCurrentOperationStatusFailed() throws Exception {
+ public void testGetCurrentOperationStatusFailed() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.CREATE_VNF_RESPONSE_PARAM_NAME, getCreateVnfResponse());
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
}
@Test
- public void testGetCurrentOperationStatusEmpty() throws Exception {
+ public void testGetCurrentOperationStatusEmpty() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.CREATE_VNF_RESPONSE_PARAM_NAME, getCreateVnfResponse());
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
}
@Test
- public void testGetCurrentOperationStatusException() throws Exception {
+ public void testGetCurrentOperationStatusException() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.CREATE_VNF_RESPONSE_PARAM_NAME, getCreateVnfResponse());
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
}
@Test
- public void testHasOperationFinished() throws Exception {
+ public void testHasOperationFinished() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.COMPLETED));
assertTrue(objUnderTest.hasOperationFinished(stubbedxecution));
}
@Test
- public void testHasOperationPending() throws Exception {
+ public void testHasOperationPending() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.absent());
assertFalse(objUnderTest.hasOperationFinished(stubbedxecution));
}
@Test
- public void testTimeOutLogFailue() throws Exception {
+ public void testTimeOutLogFailue() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
objUnderTest.timeOutLogFailue(stubbedxecution);
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1205),
}
@Test
- public void testCheckIfOperationWasSuccessful() throws Exception {
+ public void testCheckIfOperationWasSuccessful() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.COMPLETED));
MonitorVnfmCreateJobTask objUnderTest = Mockito.spy(getEtsiVnfMonitorJobTask());
objUnderTest.checkIfOperationWasSuccessful(stubbedxecution);
}
@Test
- public void testCheckIfOperationWasSuccessfulWithPending() throws Exception {
+ public void testCheckIfOperationWasSuccessfulWithPending() {
final MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.PROCESSING));
objUnderTest.checkIfOperationWasSuccessful(stubbedxecution);
}
@Test
- public void testCheckIfOperationWasSuccessfulEmpty() throws Exception {
+ public void testCheckIfOperationWasSuccessfulEmpty() {
MonitorVnfmCreateJobTask objUnderTest = getEtsiVnfMonitorJobTask();
stubbedxecution.setVariable(Constants.CREATE_VNF_RESPONSE_PARAM_NAME, getCreateVnfResponse());
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.absent());
}
@Test
- public void testGetCurrentOperationStatus() throws Exception {
+ public void testGetCurrentOperationStatus() {
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
queryJobResponse.get().setOperationState(OperationStateEnum.COMPLETED);
}
@Test
- public void testGetCurrentOperationStatusFailed() throws Exception {
+ public void testGetCurrentOperationStatusFailed() {
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
queryJobResponse.get()
.setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.CANNOT_RETRIEVE_STATUS);
}
@Test
- public void testGetCurrentOperationStatusEmpty() throws Exception {
+ public void testGetCurrentOperationStatusEmpty() {
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse);
}
@Test
- public void testGetCurrentOperationStatusException() throws Exception {
+ public void testGetCurrentOperationStatusException() {
Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse();
queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse);
}
@Test
- public void testHasOperationFinished() throws Exception {
+ public void testHasOperationFinished() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.COMPLETED));
assertTrue(objUnderTest.hasOperationFinished(stubbedxecution));
}
@Test
- public void testHasOperationPending() throws Exception {
+ public void testHasOperationPending() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.absent());
assertFalse(objUnderTest.hasOperationFinished(stubbedxecution));
}
@Test
- public void testTimeOutLogFailue() throws Exception {
+ public void testTimeOutLogFailue() {
objUnderTest.timeOutLogFailue(stubbedxecution);
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1213),
eq("Delete operation time out"));
}
@Test
- public void testCheckIfOperationWasSuccessful() throws Exception {
+ public void testCheckIfOperationWasSuccessful() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.COMPLETED));
MonitorVnfmDeleteJobTask spyObject = Mockito.spy(objUnderTest);
spyObject.checkIfOperationWasSuccessful(stubbedxecution);
}
@Test
- public void testCheckIfOperationWasSuccessfulWithPending() throws Exception {
+ public void testCheckIfOperationWasSuccessfulWithPending() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.of(OperationStateEnum.PROCESSING));
objUnderTest.checkIfOperationWasSuccessful(stubbedxecution);
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1215), anyString());
}
@Test
- public void testCheckIfOperationWasSuccessfulEmpty() throws Exception {
+ public void testCheckIfOperationWasSuccessfulEmpty() {
stubbedxecution.setVariable(Constants.OPERATION_STATUS_PARAM_NAME, Optional.absent());
objUnderTest.checkIfOperationWasSuccessful(stubbedxecution);
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1214), anyString());
public class UserParamInputParametersProviderTest {
@Test
- public void testGetInputParameter_ValidUserParams_NotEmptyInputParameter() throws Exception {
+ public void testGetInputParameter_ValidUserParams_NotEmptyInputParameter() {
final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
final InputParameter actual =
}
@Test
- public void testGetInputParameter_EmptyOrNullUserParams_EmptyInputParameter() throws Exception {
+ public void testGetInputParameter_EmptyOrNullUserParams_EmptyInputParameter() {
final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
InputParameter actual = objUnderTest.getInputParameter(Collections.emptyMap());
}
@Test
- public void testGetInputParameter_InValidExtVirtualLinks_NotEmptyInputParameter() throws Exception {
+ public void testGetInputParameter_InValidExtVirtualLinks_NotEmptyInputParameter() {
final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
final InputParameter actual =
*/
public class VnfParameterTest {
@Test
- public void testVnfParameter_equalAndHasCode() throws ClassNotFoundException {
+ public void testVnfParameter_equalAndHasCode() {
EqualsVerifier.forClass(VnfParameter.class).suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS)
.verify();
}
}
@Test
- public void runAppcCommandTest() throws Exception {
+ public void runAppcCommandTest() {
Action action = Action.QuiesceTraffic;
ControllerSelectionReference controllerSelectionReference = new ControllerSelectionReference();
controllerSelectionReference.setControllerName("testName");
}
@Test
- public void setupAuditVariableTest() throws Exception {
+ public void setupAuditVariableTest() {
AuditInventory expectedAuditInventory = new AuditInventory();
expectedAuditInventory.setCloudOwner("testCloudOwner");
expectedAuditInventory.setCloudRegion("testLcpCloudRegionId");
private ActivateVfModule activateVfModule = new ActivateVfModule();
@Test
- public void setWaitBeforeDurationTest() throws Exception {
+ public void setWaitBeforeDurationTest() {
when(env.getProperty(ActivateVfModule.VF_MODULE_TIMER_DURATION_PATH, ActivateVfModule.DEFAULT_TIMER_DURATION))
.thenReturn("PT300S");
activateVfModule.setTimerDuration(execution);
}
@Test
- public void getCloudRegionTest25() throws Exception {
+ public void getCloudRegionTest25() {
cloudRegion.setCloudRegionVersion("2.5");
nonMockAssignNetworkBBUtils.getCloudRegion(execution);
}
@Test
- public void getCloudRegionTest30() throws Exception {
+ public void getCloudRegionTest30() {
cloudRegion.setCloudRegionVersion("3.0");
nonMockAssignNetworkBBUtils.getCloudRegion(execution);
}
@Test
- public void createInstanceGroupsSunnyDayTest() throws Exception {
+ public void createInstanceGroupsSunnyDayTest() {
List<InstanceGroup> instanceGroupList = genericVnf.getInstanceGroups();
instanceGroupList.add(instanceGroup1);
}
@Test
- public void createVnfcInstanceGroupNoneTest() throws Exception {
+ public void createVnfcInstanceGroupNoneTest() {
assignVnf.createInstanceGroups(execution);
}
@Test
- public void createVnfcInstanceGroupExceptionTest() throws Exception {
+ public void createVnfcInstanceGroupExceptionTest() {
List<InstanceGroup> instanceGroupList = genericVnf.getInstanceGroups();
instanceGroupList.add(instanceGroup1);
instanceGroupList.add(instanceGroup2);
private CloudSiteCatalogUtils cloudSiteCatalogUtils = new CloudSiteCatalogUtils();
@Test
- public void testGetCloudSiteGetVersion30Test() throws Exception {
+ public void testGetCloudSiteGetVersion30Test() {
CloudSite cloudSite = new CloudSite();
String testCloudSiteId = "testCloudSiteId";
cloudSite.setClli(testCloudSiteId);
}
@Test
- public void testGetCloudSiteGetVersion25Test() throws Exception {
+ public void testGetCloudSiteGetVersion25Test() {
CloudSite cloudSite = new CloudSite();
String testCloudSiteId = "testCloudSiteId";
cloudSite.setClli(testCloudSiteId);
}
@Test
- public void testGetIdentityUrlFromCloudSiteSuccessTest() throws Exception {
+ public void testGetIdentityUrlFromCloudSiteSuccessTest() {
CloudSite cloudSite = new CloudSite();
String testCloudSiteId = "testCloudSiteId";
String testIdentityUrl = "testIdentityUrl";
}
@Test
- public void testGetIdentityUrlFromCloudSiteNoCloudIdProvidedTest() throws Exception {
+ public void testGetIdentityUrlFromCloudSiteNoCloudIdProvidedTest() {
CloudSite cloudSite = new CloudSite();
String testCloudSiteId = "testCloudSiteId";
String testIdentityUrl = "testIdentityUrl";
@Test
- public void preProcessAbstractCDSProcessingTest() throws Exception {
+ public void preProcessAbstractCDSProcessingTest() {
configDeployVnf.preProcessAbstractCDSProcessing(execution);
}
@Test
- public void updateAAIConfigureTaskTest() throws Exception {
+ public void updateAAIConfigureTaskTest() {
configDeployVnf.updateAAIConfigure(execution);
assertTrue(true);
}
@Test
- public void updateAAIConfiguredTaskTest() throws Exception {
+ public void updateAAIConfiguredTaskTest() {
configDeployVnf.updateAAIConfigured(execution);
assertTrue(true);
}
}
@Test
- public void callAppcClientTest() throws Exception {
+ public void callAppcClientTest() {
Action action = Action.ConfigScaleOut;
String vnfId = genericVnf.getVnfId();
String controllerType = "testType";
}
@Test
- public void callAppcClientExceptionTest() throws Exception {
+ public void callAppcClientExceptionTest() {
expectedException.expect(BpmnError.class);
Action action = Action.ConfigScaleOut;
String vnfId = genericVnf.getVnfId();
}
@Test
- public void testSetControllerActorScopeAction() throws Exception {
+ public void testSetControllerActorScopeAction() {
doReturn(vnfResourceCustomization).when(catalogDbClient).getVnfResourceCustomizationByModelCustomizationUUID(
@Test
- public void testSelectBB() throws Exception {
+ public void testSelectBB() {
// given
BBNameSelectionReference bbNameSelectionReference = new BBNameSelectionReference();
bbNameSelectionReference.setBbName(TEST_BBNAME);
}
@Test
- public void getCloudRegionSDNC25Test() throws Exception {
+ public void getCloudRegionSDNC25Test() {
cloudRegion.setCloudRegionVersion("2.5");
NetworkBBUtils spyAssign = Mockito.spy(NetworkBBUtils.class);
}
@Test
- public void getCloudRegionSDNC30Test() throws Exception {
+ public void getCloudRegionSDNC30Test() {
cloudRegion.setCloudRegionVersion("3.0");
NetworkBBUtils spyAssign = Mockito.spy(NetworkBBUtils.class);
}
@Test
- public void getCloudRegionPO25Test() throws Exception {
+ public void getCloudRegionPO25Test() {
cloudRegion.setCloudRegionVersion("2.5");
NetworkBBUtils spyAssign = Mockito.spy(NetworkBBUtils.class);
}
@Test
- public void getCloudRegionPO30Test() throws Exception {
+ public void getCloudRegionPO30Test() {
cloudRegion.setCloudRegionVersion("3.0");
NetworkBBUtils spyAssignPO = Mockito.spy(NetworkBBUtils.class);
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class SniroHomingV2IT extends BaseIntegrationTest {
}
@Test(expected = Test.None.class)
- public void testCallSniro_success_1VpnLink() throws BadResponseException, IOException {
+ public void testCallSniro_success_1VpnLink() throws BadResponseException {
beforeVpnBondingLink("1");
wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
}
@Test
- public void testCallSniro_success_3VpnLink() throws JsonProcessingException, BadResponseException {
+ public void testCallSniro_success_3VpnLink() throws BadResponseException {
beforeVpnBondingLink("1");
beforeVpnBondingLink("2");
beforeVpnBondingLink("3");
}
@Test
- public void testCallSniro_success_3Allotteds() throws BadResponseException, JsonProcessingException {
+ public void testCallSniro_success_3Allotteds() throws BadResponseException {
beforeAllottedResource();
wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
}
@Test
- public void testCallSniro_success_1Vnf() throws JsonProcessingException, BadResponseException {
+ public void testCallSniro_success_1Vnf() throws BadResponseException {
beforeVnf();
wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
}
@Test
- public void testCallSniro_success_3Allotteds1Vnf() throws JsonProcessingException, BadResponseException {
+ public void testCallSniro_success_3Allotteds1Vnf() throws BadResponseException {
beforeAllottedResource();
beforeVnf();
}
@Test
- public void testCallSniro_success_1ServiceProxy() throws JsonProcessingException, BadResponseException {
+ public void testCallSniro_success_1ServiceProxy() throws BadResponseException {
beforeServiceProxy();
wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
@Test(expected = BpmnError.class)
- public void testCallSniro_error_0Resources() throws BadResponseException, JsonProcessingException {
+ public void testCallSniro_error_0Resources() throws BadResponseException {
sniroHoming.callSniro(execution);
}
@Test(expected = BpmnError.class)
- public void testCallSniro_error_badResponse() throws BadResponseException, JsonProcessingException {
+ public void testCallSniro_error_badResponse() throws BadResponseException {
beforeAllottedResource();
mockResponse =
}
@Test
- public void checkRelationshipRelatedToUnassignNetworkExceptionTest() throws Exception {
+ public void checkRelationshipRelatedToUnassignNetworkExceptionTest() {
String msg = "Cannot perform Unassign Network. Network is still related to vf-module";
expectedException.expect(BpmnError.class);
doReturn(true).when(networkBBUtils).isRelationshipRelatedToExists(any(Optional.class), eq("vf-module"));
}
@Test
- public void getCloudSdncRegion25Test() throws Exception {
+ public void getCloudSdncRegion25Test() {
CloudRegion cloudRegion = setCloudRegion();
cloudRegion.setCloudRegionVersion("2.5");
doReturn("AAIAIC25").when(networkBBUtils).getCloudRegion(execution, SourceSystem.SDNC);
}
@Test
- public void getCloudSdncRegion30Test() throws Exception {
+ public void getCloudSdncRegion30Test() {
CloudRegion cloudRegion = setCloudRegion();
cloudRegion.setCloudRegionVersion("3.0");
gBBInput.setCloudRegion(cloudRegion);
}
@Test
- public void errorEncounteredTest_rollback() throws Exception {
+ public void errorEncounteredTest_rollback() {
expectedException.expect(BpmnError.class);
execution.setVariable("ErrorUnassignNetworkBB",
"Relationship's RelatedTo still exists in AAI, remove the relationship vf-module first.");
}
@Test
- public void errorEncounteredTest_noRollback() throws Exception {
+ public void errorEncounteredTest_noRollback() {
expectedException.expect(BpmnError.class);
execution.setVariable("ErrorUnassignNetworkBB",
"Relationship's RelatedTo still exists in AAI, remove the relationship vf-module first.");
}
@Test
- public void deletecreateVnfcInstanceGroupExceptionTest() throws Exception {
+ public void deletecreateVnfcInstanceGroupExceptionTest() {
expectedException.expect(BpmnError.class);
unassignVnf.deleteInstanceGroups(execution);
private ExternalTicket MOCK_externalTicket;
@Before
- public void before() throws Exception {
+ public void before() {
delegateExecution = new DelegateExecutionFake();
buildingBlockExecution = new DelegateExecutionImpl(delegateExecution);
generalBuildingBlock = new GeneralBuildingBlock();
private ExternalTicket MOCK_externalTicket;
@Before
- public void before() throws Exception {
+ public void before() {
MockitoAnnotations.initMocks(this);
delegateExecution = new DelegateExecutionFake();
buildingBlockExecution = new DelegateExecutionImpl(delegateExecution);
}
@Test
- public void completeTask_Test() throws Exception {
+ public void completeTask_Test() {
when(task.getId()).thenReturn("taskId");
when(task.getExecution()).thenReturn(mockExecution);
Map<String, Object> taskVariables = new HashMap<String, Object>();
}
@Test
- public void updateRequestDbStatus_Test() throws Exception {
+ public void updateRequestDbStatus_Test() {
InfraActiveRequests mockedRequest = new InfraActiveRequests();
when(requestsDbClient.getInfraActiveRequestbyRequestId(any(String.class))).thenReturn(mockedRequest);
doNothing().when(requestsDbClient).updateInfraActiveRequests(any(InfraActiveRequests.class));
}
@Test
- public void createGenericResourceApiNetworkOperationInformationReqContextNullTest() throws Exception {
+ public void createGenericResourceApiNetworkOperationInformationReqContextNullTest() {
RequestContext rc = new RequestContext();
rc.setMsoRequestId(null);
}
@Test
- public void reqMapperTest() throws Exception {
+ public void reqMapperTest() {
GenericResourceApiNetworkOperationInformation networkSDNCrequest =
mapper.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
}
@Test
- public void reqMapperNoCollectionTest() throws Exception {
+ public void reqMapperNoCollectionTest() {
GenericResourceApiNetworkOperationInformation networkSDNCrequest =
mapper.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network,
}
@Test
- public void activateVnfTest() throws Exception {
+ public void activateVnfTest() {
doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(eq(genericVnf),
eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncActivateTasks.activateVnf(execution);
}
@Test
- public void activateVnfTestException() throws Exception {
+ public void activateVnfTestException() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncVnfResources).activateVnf(eq(genericVnf), eq(serviceInstance),
eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
}
@Test
- public void assignServiceInstanceTest() throws Exception {
+ public void assignServiceInstanceTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources)
.assignServiceInstance(serviceInstance, customer, requestContext);
sdncAssignTasks.assignServiceInstance(execution);
}
@Test
- public void assignServiceInstanceExceptionTest() throws Exception {
+ public void assignServiceInstanceExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncServiceInstanceResources).assignServiceInstance(serviceInstance,
customer, requestContext);
}
@Test
- public void assignVnfTest() throws Exception {
+ public void assignVnfTest() {
doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(eq(genericVnf),
eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
execution.setVariable("generalBuildingBlock", gBBInput);
}
@Test
- public void assignVnfExceptionTest() throws Exception {
+ public void assignVnfExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncVnfResources).assignVnf(eq(genericVnf), eq(serviceInstance),
eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
}
@Test
- public void assignNetworkTest() throws Exception {
+ public void assignNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources).assignNetwork(network,
serviceInstance, customer, requestContext, cloudRegion);
sdncAssignTasks.assignNetwork(execution);
}
@Test
- public void assignNetworkExceptionTest() throws Exception {
+ public void assignNetworkExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncNetworkResources).assignNetwork(network, serviceInstance, customer,
requestContext, cloudRegion);
}
@Test
- public void changeModelVnfTest() throws Exception {
+ public void changeModelVnfTest() {
doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).changeModelVnf(eq(genericVnf),
eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeModelVnf(execution);
}
@Test
- public void changeModelVnfExceptionTest() throws Exception {
+ public void changeModelVnfExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncVnfResources).changeModelVnf(eq(genericVnf), eq(serviceInstance),
eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
}
@Test
- public void test_deactivateNetwork() throws Exception {
+ public void test_deactivateNetwork() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(sdncNetworkResources)
.deactivateNetwork(network, serviceInstance, customer, requestContext, cloudRegion);
sdncDeactivateTasks.deactivateNetwork(execution);
}
@Test
- public void queryVfModuleForVolumeGroupNoSelfLinkExceptionTest() throws Exception {
+ public void queryVfModuleForVolumeGroupNoSelfLinkExceptionTest() {
expectedException.expect(BpmnError.class);
vfModule.setSelflink("");
}
@Test
- public void queryVfModuleForVolumeGroupNonVfObjectExceptionTest() throws Exception {
+ public void queryVfModuleForVolumeGroupNonVfObjectExceptionTest() {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVfModuleForVolumeGroup(execution);
}
@Test
- public void convertIndicatorToBoolean_True_Test() throws MapperException, BadResponseException {
+ public void convertIndicatorToBoolean_True_Test() {
boolean testValue = sndcRequestTasks.convertIndicatorToBoolean("Y");
assertEquals(true, testValue);
}
@Test
- public void convertIndicatorToBoolean_False_Test() throws MapperException, BadResponseException {
+ public void convertIndicatorToBoolean_False_Test() {
boolean testValue = sndcRequestTasks.convertIndicatorToBoolean("N");
assertEquals(false, testValue);
}
@Test
- public void HandleTimeout_Test() throws MapperException, BadResponseException {
+ public void HandleTimeout_Test() {
doReturn("processKey").when(exceptionBuilder).getProcessKey(delegateExecution);
expectedException.expect(BpmnError.class);
sndcRequestTasks.handleTimeOutException(delegateExecution);
}
@Test
- public void processCallBack_Final_Test() throws MapperException, BadResponseException, IOException {
+ public void processCallBack_Final_Test() throws IOException {
final String sdncResponse =
new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNC_Async_Request2.xml")));
delegateExecution.setVariable("correlationName_MESSAGE", sdncResponse);
}
@Test
- public void unassignServiceInstanceTest() throws Exception {
+ public void unassignServiceInstanceTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources)
.unassignServiceInstance(serviceInstance, customer, requestContext);
sdncUnassignTasks.unassignServiceInstance(execution);
}
@Test
- public void unassignServiceInstanceExceptionTest() throws Exception {
+ public void unassignServiceInstanceExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncServiceInstanceResources).unassignServiceInstance(serviceInstance,
customer, requestContext);
}
@Test
- public void unassignVnfTest() throws Exception {
+ public void unassignVnfTest() {
doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(eq(genericVnf),
eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVnf(execution);
}
@Test
- public void unassignVnfExceptionTest() throws Exception {
+ public void unassignVnfExceptionTest() {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncVnfResources).unassignVnf(eq(genericVnf), eq(serviceInstance),
eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
}
@Test
- public void validateFailureParamsForPnfTest() throws Exception {
+ public void validateFailureParamsForPnfTest() {
invalidExecution.removeVariable(BPMN_REQUEST);
// BPMN exception is thrown in case of validation failure or invalid execution
thrown.expect(BpmnError.class);
}
@Test
- public void updateRequestDbStatusComplete_Test() throws Exception {
+ public void updateRequestDbStatusComplete_Test() {
InfraActiveRequests mockedRequest = new InfraActiveRequests();
when(requestsDbClient.getInfraActiveRequestbyRequestId(any(String.class))).thenReturn(mockedRequest);
doNothing().when(requestsDbClient).updateInfraActiveRequests(any(InfraActiveRequests.class));
}
@Test
- public void updateRequestDbStatusFailed_Test() throws Exception {
+ public void updateRequestDbStatusFailed_Test() {
WorkflowException workflowException = new WorkflowException("testProcessKey", 7000, "Error");
execution.setVariable("WorkflowException", workflowException);
InfraActiveRequests mockedRequest = new InfraActiveRequests();
}
@Test
- public void postProcessingExecuteBBActivateVfModuleNotReplaceInstanceTest() throws CloneNotSupportedException {
+ public void postProcessingExecuteBBActivateVfModuleNotReplaceInstanceTest() {
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("1");
workflowResourceIds.setVnfId("1");
}
@Test
- public void postProcessingExecuteBBActivateVfModuleReplaceInstanceHasConfigurationTest()
- throws CloneNotSupportedException {
+ public void postProcessingExecuteBBActivateVfModuleReplaceInstanceHasConfigurationTest() {
RequestDetails reqDetails = new RequestDetails();
RelatedInstanceList[] list = new RelatedInstanceList[2];
RelatedInstanceList vnfList = new RelatedInstanceList();
}
@Test
- public void postProcessingExecuteBBActivateVfModuleReplaceInstanceHasNoConfigurationTest()
- throws CloneNotSupportedException {
+ public void postProcessingExecuteBBActivateVfModuleReplaceInstanceHasNoConfigurationTest() {
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("1");
@Test
- public void getExecuteBBForConfigTest() throws CloneNotSupportedException {
+ public void getExecuteBBForConfigTest() {
BuildingBlock bbActivateVfModule = new BuildingBlock().setBpmnFlowName("ActivateVfModuleBB");
ExecuteBuildingBlock ebbActivateVfModule = new ExecuteBuildingBlock().setBuildingBlock(bbActivateVfModule);
}
@Test
- public void getUpdatedRequestTest() throws Exception {
+ public void getUpdatedRequestTest() {
List<ExecuteBuildingBlock> flowsToExecute = new ArrayList();
BuildingBlock bb1 = new BuildingBlock().setBpmnFlowName("CreateNetworkBB");
ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock().setBuildingBlock(bb1);
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
}
@Test
- public void sortExecutionPathByObjectForVlanTaggingCreateTest() throws Exception {
+ public void sortExecutionPathByObjectForVlanTaggingCreateTest() {
List<ExecuteBuildingBlock> executeFlows = new ArrayList<>();
BuildingBlock bb = new BuildingBlock().setBpmnFlowName("AssignNetworkBB").setKey("0");
}
@Test
- public void sortExecutionPathByObjectForVlanTaggingDeleteTest() throws Exception {
+ public void sortExecutionPathByObjectForVlanTaggingDeleteTest() {
List<ExecuteBuildingBlock> executeFlows = new ArrayList<>();
BuildingBlock bb = new BuildingBlock().setBpmnFlowName("DeactivateNetworkBB").setKey("0");
}
@Test
- public void queryNorthBoundRequestCatalogDbNestedTest() throws MalformedURLException {
+ public void queryNorthBoundRequestCatalogDbNestedTest() {
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AAICheckVnfInMaintBB", "AAISetVnfInMaintBB",
"VNF-Macro-Replace", "SDNOVnfHealthCheckBB", "AAIUnsetVnfInMaintBB");
}
@Test
- public void queryNorthBoundRequestCatalogDbTransportTest() throws MalformedURLException {
+ public void queryNorthBoundRequestCatalogDbTransportTest() {
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignServiceInstanceBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
private BBInputSetup mockBbInputSetup;
@Before
- public void before() throws Exception {
+ public void before() {
execution = new DelegateExecutionFake();
mockUserParamsServiceTraversal = mock(UserParamsServiceTraversal.class);
mockCatalogDbClient = mock(CatalogDbClient.class);
private String requestAction;
@Before
- public void before() throws Exception {
+ public void before() {
execution = new DelegateExecutionFake();
mockCatalogDbClient = mock(CatalogDbClient.class);
userParamsServiceTraversal = new UserParamsServiceTraversal(mockCatalogDbClient, mock(ExceptionBuilder.class));
import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class VrfValidationTest extends BaseTaskTest {
public ExpectedException exceptionRule = ExpectedException.none();
@Before
- public void before() throws Exception {
+ public void before() {
vrfValidation.setBbInputSetupUtils(bbSetupUtils);
}
}
@Test
- public void testAaiRouteTargetValidation()
- throws VrfBondingServiceException, JsonParseException, JsonMappingException, IOException {
+ public void testAaiRouteTargetValidation() throws VrfBondingServiceException, IOException {
L3Network l3Network = mapper.readValue(
new File("src/test/resources/__files/BuildingBlocks/aaiNetworkWrapper.json"), L3Network.class);
AAIResultWrapper networkWrapper = new AAIResultWrapper(l3Network);
}
@Test
- public void mapVolumeGroupTest() throws Exception {
+ public void mapVolumeGroupTest() {
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setHeatStackId("heatStackId");
volumeGroup.setModelInfoVfModule(new ModelInfoVfModule());
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doReturn;
-import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
}
@Test
- public void buildCreateNetworkRequestFromBbobjectTest() throws Exception {
+ public void buildCreateNetworkRequestFromBbobjectTest() {
String cloudRegionPo = "cloudRegionPo";
CreateNetworkRequest expectedCreateNetworkRequest = new CreateNetworkRequest();
}
@Test
- public void createNetworkRollbackRequestMapperTest() throws Exception {
+ public void createNetworkRollbackRequestMapperTest() {
String cloudRegionPo = "cloudRegionPo";
RollbackNetworkRequest expectedRollbackNetworkRequest = new RollbackNetworkRequest();
}
@Test
- public void updateNetworkRequestMapperTest() throws UnsupportedEncodingException {
+ public void updateNetworkRequestMapperTest() {
org.onap.so.openstack.beans.Subnet subnet = new org.onap.so.openstack.beans.Subnet();
subnet.setSubnetId("subnetId");
subnet.setGatewayIp("NULL");
}
@Test
- public void deleteNetworkRequestMapperTest() throws Exception {
+ public void deleteNetworkRequestMapperTest() {
DeleteNetworkRequest expectedDeleteNetworkRequest = new DeleteNetworkRequest();
String messageId = "messageId";
}
@Test
- public void deleteNetworkRequestNoHeatIdMapperTest() throws Exception {
+ public void deleteNetworkRequestNoHeatIdMapperTest() {
DeleteNetworkRequest expectedDeleteNetworkRequest = new DeleteNetworkRequest();
String messageId = "messageId";
package org.onap.so.client.adapter.vnf;
import static org.junit.Assert.assertEquals;
-import java.net.MalformedURLException;
import org.junit.Test;
public class VnfVolumeAdapterRestPropertiesTest {
}
@Test
- public void testGetUrl() throws MalformedURLException {
+ public void testGetUrl() {
assertEquals("mso.adapters.volume-groups.rest.endpoint", VnfVolumeAdapterRestProperties.endpointProp);
}
}
import org.onap.so.BaseIntegrationTest;
import org.onap.so.client.exception.BadResponseException;
import org.springframework.beans.factory.annotation.Autowired;
-import com.fasterxml.jackson.core.JsonProcessingException;
public class NamingClientIT extends BaseIntegrationTest {
@Autowired
client.deleteNameGenRequest(unassignSetup());
}
- public NameGenRequest assignSetup() throws JsonProcessingException {
+ public NameGenRequest assignSetup() {
NameGenRequest request = new NameGenRequest();
List<Element> elements = new ArrayList<>();
Element testElement = new Element();
return request;
}
- public NameGenDeleteRequest unassignSetup() throws JsonProcessingException {
+ public NameGenDeleteRequest unassignSetup() {
NameGenDeleteRequest request = new NameGenDeleteRequest();
List<Deleteelement> deleteElements = new ArrayList<>();
Deleteelement testElement = new Deleteelement();
}
@Test
- public void checkNamingPolicyAndAndEcompGeneratedNamingFalse1Test() throws BBObjectNotFoundException {
+ public void checkNamingPolicyAndAndEcompGeneratedNamingFalse1Test() {
doReturn(null).when(modelInfoServiceInstanceMock).getNamingPolicy();
doReturn(true).when(modelInfoServiceInstanceMock).getOnapGeneratedNaming();
namingServiceUtils.checkNamingPolicyAndOnapGeneratedNaming(execution);
}
@Test
- public void checkNamingPolicyAndAndEcompGeneratedNamingFalse2Test() throws BBObjectNotFoundException {
+ public void checkNamingPolicyAndAndEcompGeneratedNamingFalse2Test() {
doReturn("testNaminPolicy").when(modelInfoServiceInstanceMock).getNamingPolicy();
doReturn(false).when(modelInfoServiceInstanceMock).getOnapGeneratedNaming();
namingServiceUtils.checkNamingPolicyAndOnapGeneratedNaming(execution);
}
@Test
- public void checkNamingPolicyAndAndEcompGeneratedNamingFalse3Test() throws BBObjectNotFoundException {
+ public void checkNamingPolicyAndAndEcompGeneratedNamingFalse3Test() {
doReturn("").when(modelInfoServiceInstanceMock).getNamingPolicy();
doReturn(false).when(modelInfoServiceInstanceMock).getOnapGeneratedNaming();
namingServiceUtils.checkNamingPolicyAndOnapGeneratedNaming(execution);
}
@Test
- public void checkNamingPolicyAndAndEcompGeneratedNamingFalse4Test() throws BBObjectNotFoundException {
+ public void checkNamingPolicyAndAndEcompGeneratedNamingFalse4Test() {
doReturn("bonding").when(modelInfoServiceInstanceMock).getNamingPolicy();
doReturn(null).when(modelInfoServiceInstanceMock).getOnapGeneratedNaming();
namingServiceUtils.checkNamingPolicyAndOnapGeneratedNaming(execution);
}
@Test
- public void createCollectionTest() throws Exception {
+ public void createCollectionTest() {
networkCollection.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
doReturn(new org.onap.aai.domain.yang.Collection()).when(MOCK_aaiObjectMapper).mapCollection(networkCollection);
}
@Test
- public void updateCollectionTest() throws Exception {
+ public void updateCollectionTest() {
doReturn(new org.onap.aai.domain.yang.Collection()).when(MOCK_aaiObjectMapper).mapCollection(networkCollection);
aaiCollectionResources.updateCollection(networkCollection);
verify(MOCK_aaiResourcesClient, times(1)).update(
}
@Test
- public void deleteCollectionTest() throws Exception {
+ public void deleteCollectionTest() {
aaiCollectionResources.deleteCollection(networkCollection);
verify(MOCK_aaiResourcesClient, times(1)).delete(eq(
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().collection(networkCollection.getId()))));
}
@Test
- public void connectVrfConfigurationToVnrConfigurationTest() throws Exception {
+ public void connectVrfConfigurationToVnrConfigurationTest() {
Configuration vrfConfiguration = buildConfiguration();
Configuration vnrConfiguration = buildConfiguration();
doNothing().when(MOCK_aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
}
@Test
- public void connectConfigurationToPnfObjectTest() throws Exception {
+ public void connectConfigurationToPnfObjectTest() {
doNothing().when(MOCK_aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
Pnf primaryPnf = serviceProxy.getServiceInstance().getPnfs().stream().filter(o -> o.getRole().equals("Primary"))
}
@Test
- public void updateOrchestrationStatusConfigurationTest() throws Exception {
+ public void updateOrchestrationStatusConfigurationTest() {
configuration.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
isA(org.onap.aai.domain.yang.Configuration.class));
}
@Test
- public void updateConfigurationOrchestrationStatusTest() throws Exception {
+ public void updateConfigurationOrchestrationStatusTest() {
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
isA(org.onap.aai.domain.yang.Configuration.class));
aaiConfigurationResources.updateConfigurationOrchestrationStatus(configuration, OrchestrationStatus.ACTIVE);
}
@Test
- public void createInstanceGroupTest() throws Exception {
+ public void createInstanceGroupTest() {
doReturn(new org.onap.aai.domain.yang.InstanceGroup()).when(MOCK_aaiObjectMapper)
.mapInstanceGroup(instanceGroup);
aaiInstanceGroupResources.createInstanceGroup(instanceGroup);
}
@Test
- public void deleteInstanceGroupTest() throws Exception {
+ public void deleteInstanceGroupTest() {
aaiInstanceGroupResources.deleteInstanceGroup(instanceGroup);
verify(MOCK_aaiResourcesClient, times(1)).delete(eq(
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroup(instanceGroup.getId()))));
}
@Test
- public void connectInstanceGroupTest() throws Exception {
+ public void connectInstanceGroupTest() {
aaiInstanceGroupResources.connectInstanceGroupToVnf(instanceGroup, vnf);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory
}
@Test
- public void connectInstanceGroupWithEdgeTest() throws Exception {
+ public void connectInstanceGroupWithEdgeTest() {
aaiInstanceGroupResources.connectInstanceGroupToVnf(instanceGroup, vnf, AAIEdgeLabel.BELONGS_TO);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory
}
@Test
- public void existsTest() throws Exception {
+ public void existsTest() {
aaiInstanceGroupResources.exists(instanceGroup);
verify(MOCK_aaiResourcesClient, times(1)).exists(eq(
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroup(instanceGroup.getId()))));
}
@Test
- public void checkInstanceGroupNameInUseTrueTest() throws Exception {
+ public void checkInstanceGroupNameInUseTrueTest() {
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroups())
.queryParam("instance-group-name", "instanceGroupName");
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
}
@Test
- public void checkInstanceGroupNameInUseFalseTest() throws Exception {
+ public void checkInstanceGroupNameInUseFalseTest() {
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroups())
.queryParam("instance-group-name", "instanceGroupName");
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
@Test
- public void updateNetworkTest() throws Exception {
+ public void updateNetworkTest() {
network.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
}
@Test
- public void createNetworkConnectToServiceInstanceTest() throws Exception {
+ public void createNetworkConnectToServiceInstanceTest() {
network.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
}
@Test
- public void deleteNetworkTest() throws Exception {
+ public void deleteNetworkTest() {
network.setOrchestrationStatus(OrchestrationStatus.INVENTORIED);
}
@Test
- public void createNetworkCollectionTest() throws Exception {
+ public void createNetworkCollectionTest() {
doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class),
isA(org.onap.aai.domain.yang.Collection.class));
}
@Test
- public void createNetworkInstanceGroupTest() throws Exception {
+ public void createNetworkInstanceGroupTest() {
doReturn(new org.onap.aai.domain.yang.InstanceGroup()).when(MOCK_aaiObjectMapper)
.mapInstanceGroup(instanceGroup);
doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class),
}
@Test
- public void connectNetworkToNetworkCollectionInstanceGroupTest() throws Exception {
+ public void connectNetworkToNetworkCollectionInstanceGroupTest() {
aaiNetworkResources.connectNetworkToNetworkCollectionInstanceGroup(network, instanceGroup);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory
}
@Test
- public void connectNetworkToNetworkCollectionServiceInstanceTest() throws Exception {
+ public void connectNetworkToNetworkCollectionServiceInstanceTest() {
aaiNetworkResources.connectNetworkToNetworkCollectionServiceInstance(network, serviceInstance);
verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class),
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network(network.getNetworkId()))));
}
@Test
- public void connectNetworkToCloudRegionTest() throws Exception {
+ public void connectNetworkToCloudRegionTest() {
aaiNetworkResources.connectNetworkToCloudRegion(network, cloudRegion);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network(network.getNetworkId()))),
}
@Test
- public void connectNetworkToTenantTest() throws Exception {
+ public void connectNetworkToTenantTest() {
aaiNetworkResources.connectNetworkToTenant(network, cloudRegion);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
}
@Test
- public void connectNetworkCollectionInstanceGroupToNetworkCollectionTest() throws Exception {
+ public void connectNetworkCollectionInstanceGroupToNetworkCollectionTest() {
aaiNetworkResources.connectNetworkCollectionInstanceGroupToNetworkCollection(instanceGroup, collection);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().collection(collection.getId()))),
}
@Test
- public void connectNetworkCollectionToServiceInstanceTest() throws Exception {
+ public void connectNetworkCollectionToServiceInstanceTest() {
aaiNetworkResources.connectNetworkCollectionToServiceInstance(collection, serviceInstance);
verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class));
}
@Test
- public void deleteCollectionTest() throws Exception {
+ public void deleteCollectionTest() {
doNothing().when(MOCK_aaiResourcesClient).delete(isA(AAIResourceUri.class));
aaiNetworkResources.deleteCollection(collection);
verify(MOCK_aaiResourcesClient, times(1)).delete(any(AAIResourceUri.class));
}
@Test
- public void deleteInstanceGroupTest() throws Exception {
+ public void deleteInstanceGroupTest() {
doNothing().when(MOCK_aaiResourcesClient).delete(isA(AAIResourceUri.class));
aaiNetworkResources.deleteNetworkInstanceGroup(instanceGroup);
verify(MOCK_aaiResourcesClient, times(1)).delete(any(AAIResourceUri.class));
}
@Test
- public void updateSubnetTest() throws Exception {
+ public void updateSubnetTest() {
doReturn(new org.onap.aai.domain.yang.Subnet()).when(MOCK_aaiObjectMapper).mapSubnet(subnet);
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
}
@Test
- public void connectInstanceGroupToCloudRegionTest() throws Exception {
+ public void connectInstanceGroupToCloudRegionTest() {
aaiNetworkResources.connectInstanceGroupToCloudRegion(instanceGroup, cloudRegion);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory
}
@Test
- public void createNetworkPolicyTest() throws Exception {
+ public void createNetworkPolicyTest() {
doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class),
isA(org.onap.aai.domain.yang.NetworkPolicy.class));
doReturn(new org.onap.aai.domain.yang.NetworkPolicy()).when(MOCK_aaiObjectMapper)
}
@Test
- public void deleteNetworkPolicyTest() throws Exception {
+ public void deleteNetworkPolicyTest() {
doNothing().when(MOCK_aaiResourcesClient).delete(isA(AAIResourceUri.class));
aaiNetworkResources.deleteNetworkPolicy(networkPolicy.getNetworkPolicyId());
verify(MOCK_aaiResourcesClient, times(1)).delete(any(AAIResourceUri.class));
}
@Test
- public void checkInstanceGroupNameInUseTrueTest() throws Exception {
+ public void checkInstanceGroupNameInUseTrueTest() {
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Networks())
.queryParam("network-name", "networkName");
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
}
@Test
- public void checkInstanceGroupNameInUseFalseTest() throws Exception {
+ public void checkInstanceGroupNameInUseFalseTest() {
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Networks())
.queryParam("network-name", "networkName");
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
}
@Test
- public void deleteServiceInstanceSuccessTest() throws Exception {
+ public void deleteServiceInstanceSuccessTest() {
aaiServiceInstanceResources.deleteServiceInstance(serviceInstance);
verify(MOCK_aaiResourcesClient, times(1)).delete(any(AAIResourceUri.class));
}
@Test
- public void deleteServiceInstanceExceptionTest() throws Exception {
+ public void deleteServiceInstanceExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_aaiResourcesClient).delete(isA(AAIResourceUri.class));
aaiServiceInstanceResources.deleteServiceInstance(serviceInstance);
}
@Test
- public void checkInstanceServiceNameInUseTrueTest() throws Exception {
+ public void checkInstanceServiceNameInUseTrueTest() {
AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment())
.queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
}
@Test
- public void checkInstanceServiceNameInUseFalseTest() throws Exception {
+ public void checkInstanceServiceNameInUseFalseTest() {
AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment())
.queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
}
@Test
- public void updateOrchestrationStatusVfModuleTest() throws Exception {
+ public void updateOrchestrationStatusVfModuleTest() {
vfModule.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
}
@Test
- public void createVfModuleTest() throws Exception {
+ public void createVfModuleTest() {
vfModule.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
doReturn(new org.onap.aai.domain.yang.VfModule()).when(MOCK_aaiObjectMapper).mapVfModule(vfModule);
}
@Test
- public void deleteVfModuleTest() throws Exception {
+ public void deleteVfModuleTest() {
doNothing().when(MOCK_aaiResourcesClient).delete(isA(AAIResourceUri.class));
aaiVfModuleResources.deleteVfModule(vfModule, vnf);
}
@Test
- public void changeAssignVfModuleTest() throws Exception {
+ public void changeAssignVfModuleTest() {
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
isA(org.onap.aai.domain.yang.VfModule.class));
}
@Test
- public void connectVfModuleToVolumeGroupTest() throws Exception {
+ public void connectVfModuleToVolumeGroupTest() {
VolumeGroup volumeGroup = buildVolumeGroup();
volumeGroup.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
}
@Test
- public void updateHeatStackIdVfModuleTest() throws Exception {
+ public void updateHeatStackIdVfModuleTest() {
vfModule.setHeatStackId("testHeatStackId");
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
}
@Test
- public void updateContrailServiceInstanceFqdnVfModuleTest() throws Exception {
+ public void updateContrailServiceInstanceFqdnVfModuleTest() {
vfModule.setContrailServiceInstanceFqdn("testContrailServiceInstanceFqdn");
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
}
@Test
- public void checkNameInUseTrueTest() throws Exception {
+ public void checkNameInUseTrueTest() {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment())
.queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
}
@Test
- public void checkNameInUseFalseIsResumeTest() throws Exception {
+ public void checkNameInUseFalseIsResumeTest() {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment())
.queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
}
@Test
- public void checkNameInUseFalseTest() throws Exception {
+ public void checkNameInUseFalseTest() {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment())
.queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
}
@Test
- public void connectVnfToTenantTest() throws Exception {
+ public void connectVnfToTenantTest() {
aaiVnfResources.connectVnfToTenant(genericVnf, cloudRegion);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
}
@Test
- public void connectVnfToCloudRegionTest() throws Exception {
+ public void connectVnfToCloudRegionTest() {
aaiVnfResources.connectVnfToCloudRegion(genericVnf, cloudRegion);
verify(MOCK_aaiResourcesClient, times(1)).connect(
eq(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnf.getVnfId()))),
@Test
- public void updateOrchestrationStatusVolumeGroupTest() throws Exception {
+ public void updateOrchestrationStatusVolumeGroupTest() {
volumeGroup.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
}
@Test
- public void createVolumeGroupTest() throws Exception {
+ public void createVolumeGroupTest() {
volumeGroup.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class),
}
@Test
- public void connectVolumeGroupToVnfTest() throws Exception {
+ public void connectVolumeGroupToVnfTest() {
volumeGroup.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
}
@Test
- public void connectVolumeGroupToTenantTest() throws Exception {
+ public void connectVolumeGroupToTenantTest() {
GenericVnf genericVnf = buildGenericVnf();
volumeGroup.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
}
@Test
- public void updateHeatStackIdVolumeGroupTest() throws Exception {
+ public void updateHeatStackIdVolumeGroupTest() {
volumeGroup.setHeatStackId("testVolumeHeatStackId");
doNothing().when(MOCK_aaiResourcesClient).update(isA(AAIResourceUri.class),
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
}
@Test
- public void assignNetworkTest() throws Exception {
+ public void assignNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void rollbackAssignNetworkTest() throws Exception {
+ public void rollbackAssignNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN,
GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void activateNetworkTest() throws Exception {
+ public void activateNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ACTIVATE,
GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void deleteNetworkTest() throws Exception {
+ public void deleteNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.DELETE,
GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void test_deactivateNetwork() throws MapperException, BadResponseException {
+ public void test_deactivateNetwork() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE,
GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void changeAssignNetworkTest() throws MapperException, BadResponseException {
+ public void changeAssignNetworkTest() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance,
}
@Test
- public void unassignNetwork_Test() throws Exception {
+ public void unassignNetwork_Test() {
doReturn(new GenericResourceApiNetworkOperationInformation()).when(MOCK_networkTopologyOperationRequestMapper)
.reqMapper(SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN,
GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance,
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
}
@Test
- public void assignServiceInstanceSuccessTest() throws Exception {
+ public void assignServiceInstanceSuccessTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(MOCK_serviceTopologyOperationMapper)
.reqMapper(eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.ASSIGN),
eq(GenericResourceApiRequestActionEnumeration.CREATESERVICEINSTANCE),
}
@Test
- public void assignServiceInstanceExceptionTest() throws Exception {
+ public void assignServiceInstanceExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_serviceTopologyOperationMapper).reqMapper(
eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.ASSIGN),
}
@Test
- public void deleteServiceInstanceSuccessTest() throws Exception {
+ public void deleteServiceInstanceSuccessTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(MOCK_serviceTopologyOperationMapper)
.reqMapper(eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DELETE),
eq(GenericResourceApiRequestActionEnumeration.DELETESERVICEINSTANCE),
}
@Test
- public void deleteServiceInstanceExceptionTest() throws Exception {
+ public void deleteServiceInstanceExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_serviceTopologyOperationMapper).reqMapper(
eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DELETE),
}
@Test
- public void unassignServiceInstanceSuccessTest() throws Exception {
+ public void unassignServiceInstanceSuccessTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(MOCK_serviceTopologyOperationMapper)
.reqMapper(eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DELETE),
eq(GenericResourceApiRequestActionEnumeration.DELETESERVICEINSTANCE),
}
@Test
- public void unassignServiceInstanceExceptionTest() throws Exception {
+ public void unassignServiceInstanceExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_serviceTopologyOperationMapper).reqMapper(
eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DELETE),
}
@Test
- public void deactivateServiceInstanceSuccessTest() throws Exception {
+ public void deactivateServiceInstanceSuccessTest() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(MOCK_serviceTopologyOperationMapper)
.reqMapper(eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
eq(GenericResourceApiRequestActionEnumeration.DELETESERVICEINSTANCE),
}
@Test
- public void deactivateServiceInstanceExceptionTest() throws Exception {
+ public void deactivateServiceInstanceExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_serviceTopologyOperationMapper).reqMapper(
eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
}
@Test
- public void test_changeModelServiceInstance() throws MapperException, BadResponseException {
+ public void test_changeModelServiceInstance() {
doReturn(new GenericResourceApiServiceOperationInformation()).when(MOCK_serviceTopologyOperationMapper)
.reqMapper(eq(SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION), eq(SDNCSvcAction.CHANGE_ASSIGN),
eq(GenericResourceApiRequestActionEnumeration.CREATESERVICEINSTANCE),
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;;
}
@Test
- public void changeAssignVfModuleTest() throws MapperException, BadResponseException {
+ public void changeAssignVfModuleTest() throws MapperException {
doReturn(sdncReq).when(vfModuleTopologyMapper).reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION,
SDNCSvcAction.CHANGE_ASSIGN, vfModule, null, vnf, serviceInstance, customer, cloudRegion,
requestContext, null, testURI);
}
@Test
- public void unassignVnfSuccessTest() throws Exception {
+ public void unassignVnfSuccessTest() {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
}
@Test
- public void unassignVnfExceptionTest() throws Exception {
+ public void unassignVnfExceptionTest() {
expectedException.expect(Exception.class);
doThrow(Exception.class).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
public class CommonObjectMapperProviderTest {
@Test
- public void shouldSetCorrectMapperProperties() throws Exception {
+ public void shouldSetCorrectMapperProperties() {
// given
CommonObjectMapperProvider provider = new CommonObjectMapperProvider();
// when
package org.onap.so.client.dmaap;
import static org.junit.Assert.assertEquals;
-import java.io.FileNotFoundException;
import java.io.IOException;
import org.junit.Test;
import org.onap.so.client.sdno.dmaap.SDNOHealthCheckDmaapConsumer;
public class DmaapClientTest {
@Test
- public void deobfuscateTest() throws FileNotFoundException, IOException {
+ public void deobfuscateTest() throws IOException {
String encodedBase64 = "dGVzdHBhc3N3b3Jk";
String notEncoded = "testpassword";
DmaapConsumer consumer = new SDNOHealthCheckDmaapConsumer();
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.*;
-import java.net.UnknownHostException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
}
@Test
- public void thatServerNameIsSetOnStartup() throws UnknownHostException {
+ public void thatServerNameIsSetOnStartup() {
loggerStartupListener.start();
verify(context).putProperty(eq("server.name"), anyString());
private ExternalTaskClient actualClient4;
@Test
- public void testCheckActiveClients() throws Exception {
+ public void testCheckActiveClients() {
Set<ExternalTaskClient> taskClients = ConcurrentHashMap.newKeySet();
taskClients.add(actualClient1);
taskClients.add(actualClient2);
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
}
@Override
- public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers)
- throws IOException, JsonProcessingException {
+ public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
if (value instanceof String) {
gen.writeRawValue((String) value);
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
}
@Override
- public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers)
- throws IOException, JsonProcessingException {
+ public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
if (value instanceof String) {
gen.writeRawValue((String) value);
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
}
@Override
- public void serialize(String value, JsonGenerator gen, SerializerProvider serializers)
- throws IOException, JsonProcessingException {
+ public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
if ("".equals(value)) {
gen.writeNull();
package org.onap.aaiclient.client.aai;
import static org.junit.Assert.assertTrue;
-import java.net.URISyntaxException;
import org.javatuples.Pair;
import org.junit.Test;
@Test
- public void verifyHeadersTest() throws URISyntaxException {
+ public void verifyHeadersTest() {
AAIDSLQueryClient client = new AAIDSLQueryClient();
assertTrue(client.getClient().getAdditionalHeaders().get("ALL").contains(Pair.with("X-DslApiVersion", "V2")));
public class AAIObjectTypeTest {
@Test
- public void fromTypeNameTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
+ public void fromTypeNameTest() throws IllegalArgumentException {
AAIObjectType type = AAIObjectType.fromTypeName("generic-query");
assertEquals("generic-query", type.typeName());
}
@Test
- public void customTypeTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
+ public void customTypeTest() throws IllegalArgumentException {
AAIObjectType type = AAIObjectType.fromTypeName("my-custom-name");
assertEquals("my-custom-name", type.typeName());
@Test
- public void cacheGetTest() throws URISyntaxException, InterruptedException {
+ public void cacheGetTest() throws URISyntaxException {
wireMockRule.stubFor(get(urlPathMatching("/cached"))
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/plain").withBody("value")));
}
@Test
- public void cachePutTest() throws URISyntaxException, InterruptedException {
+ public void cachePutTest() throws URISyntaxException {
wireMockRule.stubFor(put(urlPathMatching("/cached/1")).willReturn(aResponse().withStatus(200)));
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
import org.onap.aaiclient.client.graphinventory.GraphInventoryPatchConverter;
import org.skyscreamer.jsonassert.JSONAssert;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
public AAIResourcesClient aaiClient = new AAIResourcesClient();
@Before
- public void before() throws JsonParseException, JsonMappingException, IOException {
+ public void before() {
mapper = new AAICommonObjectMapperProvider().getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
}
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
import org.onap.aaiclient.client.graphinventory.GraphInventoryPatchConverter;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
public AAIResourcesClient aaiClient = new AAIResourcesClient();
@Before
- public void before() throws JsonParseException, JsonMappingException, IOException {
+ public void before() {
mapper = new AAICommonObjectMapperProvider().getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
}
protected AAIRestClientI client;
@Test
- public void getClientTest() throws Exception {
+ public void getClientTest() {
test.getClient();
}
@Test
- public void setClientTest() throws Exception {
+ public void setClientTest() {
test.setClient(client);
}
import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
import org.springframework.util.SerializationUtils;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
}
@Test
- public void testAAIResultWrapperIsSerializable() throws IOException {
+ public void testAAIResultWrapperIsSerializable() {
AAIResultWrapper original = new AAIResultWrapper("");
byte[] serialized = SerializationUtils.serialize(original);
AAIResultWrapper deserialized = (AAIResultWrapper) SerializationUtils.deserialize(serialized);
}
@Test
- public void testAsMap() throws JsonParseException, JsonMappingException, IOException {
+ public void testAsMap() throws JsonMappingException, IOException {
ObjectMapper mapper = new AAICommonObjectMapperProvider().getMapper();
Map<String, Object> expected = mapper.readValue(json, new TypeReference<Map<String, Object>>() {});
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
-import java.io.IOException;
import java.net.URI;
-import java.net.URISyntaxException;
import javax.ws.rs.core.UriBuilder;
import org.junit.Test;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
public class AllottedResourceLookupUriTest {
@Test
- public void oneKey()
- throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKey() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
AllottedResourceLookupUri instance = new AllottedResourceLookupUri(Types.ALLOTTED_RESOURCE.getFragment("key1"));
AllottedResourceLookupUri spy = spy(instance);
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.URI;
-import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Optional;
}
@Test
- public void oneKey()
- throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKey() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
}
@Test
- public void oneKeyQueryParams()
- throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKeyQueryParams() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
}
@Test
- public void oneKeyEncoded()
- throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKeyEncoded() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
}
@Test
- public void oneKeyGetKeys()
- throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKeyGetKeys() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
}
@Test
- public void oneKeyClone() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void oneKeyClone() {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
String uri =
}
@Test
- public void notfound() throws IOException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void notfound() throws IOException {
final String content =
new String(Files.readAllBytes(Paths.get(AAI_JSON_FILE_LOCATION + "empty-query-result.json")));
}
@Test
- public void noVertexFound() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void noVertexFound() {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key3"));
ServiceInstanceUri spy = spy(instance);
AAIResourcesClient client = aaiClient;
}
@Test
- public void serializeTest() throws IOException, ClassNotFoundException, GraphInventoryUriNotFoundException,
- GraphInventoryPayloadException {
+ public void serializeTest() throws IOException, ClassNotFoundException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key3"));
final String content = new String(
Files.readAllBytes(Paths.get(AAI_JSON_FILE_LOCATION + "service-instance-pathed-query.json")));
}
@Test
- public void relatedToEqualityTestBeforeBuildTest()
- throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+ public void relatedToEqualityTestBeforeBuildTest() {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
-import java.net.URISyntaxException;
import java.util.HashMap;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
private ObjectMapper mapper = new AAICommonObjectMapperProvider().getMapper();
@Test
- public void convertObjectToPatchFormatTest()
- throws URISyntaxException, JsonParseException, JsonMappingException, IOException {
+ public void convertObjectToPatchFormatTest() throws JsonMappingException, IOException {
GraphInventoryPatchConverter validator = new GraphInventoryPatchConverter();
GenericVnf vnf = new GenericVnf();
vnf.setIpv4Loopback0Address("");
}
@Test
- public void convertStringToPatchFormatTest()
- throws URISyntaxException, JsonParseException, JsonMappingException, IOException {
+ public void convertStringToPatchFormatTest() {
GraphInventoryPatchConverter validator = new GraphInventoryPatchConverter();
String payload = "{\"ipv4-loopback0-address\":\"\"}";
String result = validator.marshallObjectToPatchFormat(payload);
}
@Test
- public void convertStringToPatchFormatNull_Test()
- throws URISyntaxException, JsonParseException, JsonMappingException, IOException {
+ public void convertStringToPatchFormatNull_Test() {
GraphInventoryPatchConverter validator = new GraphInventoryPatchConverter();
String payload = "{\"ipv4-loopback0-address\": null}";
String result = validator.marshallObjectToPatchFormat(payload);
}
@Test
- public void convertMapToPatchFormatTest()
- throws URISyntaxException, JsonParseException, JsonMappingException, IOException {
+ public void convertMapToPatchFormatTest() {
GraphInventoryPatchConverter validator = new GraphInventoryPatchConverter();
HashMap<String, String> map = new HashMap<>();
map.put("ipv4-loopback0-address", "");
Throwable t = new Throwable();
@Test
- public void callConstructorTest() throws Exception {
+ public void callConstructorTest() {
GraphInventoryPayloadException test1 = new GraphInventoryPayloadException("testing");
BpmnRequest bpmnRequest = new BpmnRequest();
@Test
- public void getHostTest() throws Exception {
+ public void getHostTest() {
bpmnRequest.getHost();
}
@Test
- public void setHostTest() throws Exception {
+ public void setHostTest() {
bpmnRequest.setHost(new CamundaInput());
}
@Test
- public void getRequestIdTest() throws Exception {
+ public void getRequestIdTest() {
bpmnRequest.getRequestId();
}
@Test
- public void setRequestIdTest() throws Exception {
+ public void setRequestIdTest() {
bpmnRequest.setRequestId(new CamundaInput());
}
@Test
- public void getIsBaseVfModuleTest() throws Exception {
+ public void getIsBaseVfModuleTest() {
bpmnRequest.getIsBaseVfModule();
}
@Test
- public void setIsBaseVfModuleTest() throws Exception {
+ public void setIsBaseVfModuleTest() {
bpmnRequest.setIsBaseVfModule(new CamundaBooleanInput());
}
@Test
- public void getRecipeTimeoutTest() throws Exception {
+ public void getRecipeTimeoutTest() {
bpmnRequest.getRecipeTimeout();
}
@Test
- public void setRecipeTimeoutTest() throws Exception {
+ public void setRecipeTimeoutTest() {
bpmnRequest.setRecipeTimeout(new CamundaIntegerInput());
}
@Test
- public void getRequestActionTest() throws Exception {
+ public void getRequestActionTest() {
bpmnRequest.getRequestAction();
}
@Test
- public void setRequestActionTest() throws Exception {
+ public void setRequestActionTest() {
bpmnRequest.setRequestAction(new CamundaInput());
}
@Test
- public void getServiceInstanceIdTest() throws Exception {
+ public void getServiceInstanceIdTest() {
bpmnRequest.getServiceInstanceId();
}
@Test
- public void setServiceInstanceIdTest() throws Exception {
+ public void setServiceInstanceIdTest() {
bpmnRequest.setServiceInstanceId(new CamundaInput());
}
@Test
- public void getVnfIdTest() throws Exception {
+ public void getVnfIdTest() {
bpmnRequest.getVnfId();
}
@Test
- public void setVnfIdTest() throws Exception {
+ public void setVnfIdTest() {
bpmnRequest.setVnfId(new CamundaInput());
}
@Test
- public void getVfModuleIdTest() throws Exception {
+ public void getVfModuleIdTest() {
bpmnRequest.getVnfId();
}
@Test
- public void setVfModuleIdTest() throws Exception {
+ public void setVfModuleIdTest() {
bpmnRequest.setVfModuleId(new CamundaInput());
}
@Test
- public void getVolumeGroupIdTest() throws Exception {
+ public void getVolumeGroupIdTest() {
bpmnRequest.getVolumeGroupId();
}
@Test
- public void setVolumeGroupIdTest() throws Exception {
+ public void setVolumeGroupIdTest() {
bpmnRequest.setVolumeGroupId(new CamundaInput());
}
@Test
- public void getNetworkIdTest() throws Exception {
+ public void getNetworkIdTest() {
bpmnRequest.getNetworkId();
}
@Test
- public void setNetworkIdTest() throws Exception {
+ public void setNetworkIdTest() {
bpmnRequest.setNetworkId(new CamundaInput());
}
@Test
- public void getServiceTypeTest() throws Exception {
+ public void getServiceTypeTest() {
bpmnRequest.getServiceType();
}
@Test
- public void setServiceTypeTest() throws Exception {
+ public void setServiceTypeTest() {
bpmnRequest.setServiceType(new CamundaInput());
}
@Test
- public void getVnfTypeTest() throws Exception {
+ public void getVnfTypeTest() {
bpmnRequest.getVnfType();
}
@Test
- public void setVnfTypeTest() throws Exception {
+ public void setVnfTypeTest() {
bpmnRequest.setVnfType(new CamundaInput());
}
@Test
- public void getVfModuleTypeTest() throws Exception {
+ public void getVfModuleTypeTest() {
bpmnRequest.getVfModuleType();
}
@Test
- public void setVfModuleTypeTest() throws Exception {
+ public void setVfModuleTypeTest() {
bpmnRequest.setVfModuleType(new CamundaInput());
}
@Test
- public void getNetworkTypeTest() throws Exception {
+ public void getNetworkTypeTest() {
bpmnRequest.getNetworkType();
}
@Test
- public void setNetworkTypeTest() throws Exception {
+ public void setNetworkTypeTest() {
bpmnRequest.setNetworkType(new CamundaInput());
}
@Test
- public void getRequestDetailsTest() throws Exception {
+ public void getRequestDetailsTest() {
bpmnRequest.getRequestDetails();
}
@Test
- public void setRequestDetailsTest() throws Exception {
+ public void setRequestDetailsTest() {
bpmnRequest.setRequestDetails(new CamundaInput());
}
}
@Test
- public void createBPMNFailureExceptionTest() throws IOException {
+ public void createBPMNFailureExceptionTest() {
String response = "Request failed";
HttpClientErrorException e =
new HttpClientErrorException(HttpStatus.INTERNAL_SERVER_ERROR, null, response.getBytes(), null);
package org.onap.so.apihandler.common;
-import java.io.IOException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
public ExpectedException thrown = ExpectedException.none();
@Test
- public void acceptedResponseTest() throws IOException, BPMNFailureException {
+ public void acceptedResponseTest() throws BPMNFailureException {
ResponseEntity<String> camundaResponse = ResponseEntity.noContent().build();
thrown.expect(BPMNFailureException.class);
thrown.expectMessage("Request Failed due to BPEL error with HTTP Status = 204");
}
@Test
- public void acceptedOrNoContentResponseTest() throws IOException, BPMNFailureException {
+ public void acceptedOrNoContentResponseTest() throws BPMNFailureException {
ResponseEntity<String> camundaResponse = ResponseEntity.badRequest().build();
thrown.expect(BPMNFailureException.class);
thrown.expectMessage("Request Failed due to BPEL error with HTTP Status = 400");
private static final String REQUEST_ID = "32807a28-1a14-4b88-b7b3-2950918aa769";
private ObjectMapper mapper = new ObjectMapper();
- private RequestError getRequestError() throws IOException {
+ private RequestError getRequestError() {
RequestError requestError = new RequestError();
mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
ServiceException serviceException = new ServiceException();
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import javax.xml.bind.Marshaller;
}
@Test
- public void testDuplicateRequestResponse() throws IOException {
+ public void testDuplicateRequestResponse() {
DuplicateRequestException duplicateRequestException = new DuplicateRequestException.Builder("Test1", "Test2",
"Test3", "Test4", HttpStatus.SC_BAD_GATEWAY, ErrorNumbers.SVC_BAD_PARAMETER).build();
Response resp = mapper.toResponse((ApiException) duplicateRequestException);
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@Component
return (s == null || s.trim().isEmpty());
}
- public String getRequestJSON(ServiceInstancesRequest sir)
- throws JsonGenerationException, JsonMappingException, IOException {
+ public String getRequestJSON(ServiceInstancesRequest sir) throws IOException {
logger.debug("building sir from object {}", sir);
String requestJSON = nonNullMapper.writeValueAsString(sir);
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
-import java.net.UnknownHostException;
@Path("/nodehealthcheck")
@OpenAPIDefinition(info = @Info(title = "/nodehealthcheck", description = "API Handler Infra Node Health Check"))
@Operation(description = "Performing node health check", responses = @ApiResponse(
content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
- public Response nodeHealthcheck(@Context ContainerRequestContext requestContext) throws UnknownHostException {
+ public Response nodeHealthcheck(@Context ContainerRequestContext requestContext) {
// Generated RequestId
String requestId = requestContext.getProperty("requestId").toString();
logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
}
}
- private Response getSubnetCapabilities(List<SubnetTypes> subnetTypes, String version) throws ApiException {
+ private Response getSubnetCapabilities(List<SubnetTypes> subnetTypes, String version) {
String inputFileString = "";
Map<String, Object> subnetCapability = new HashMap<>();
BufferedReader br = null;
import org.json.JSONObject;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.ResponseBuilder;
-import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.onap.so.db.request.beans.OrchestrationTask;
import org.onap.so.db.request.client.RequestsDbClient;
import org.onap.logging.filter.base.ErrorCode;
content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
@Transactional
- public Response getOrchestrationTask(@PathParam("taskId") String taskId, @PathParam("version") String version)
- throws ApiException {
+ public Response getOrchestrationTask(@PathParam("taskId") String taskId, @PathParam("version") String version) {
try {
OrchestrationTask orchestrationTask = requestsDbClient.getOrchestrationTask(taskId);
return builder.buildResponse(HttpStatus.SC_OK, null, orchestrationTask, version);
import org.onap.aaiclient.client.graphinventory.entities.Start;
import org.onap.aaiclient.client.graphinventory.entities.TraversalBuilder;
import org.onap.aaiclient.client.graphinventory.entities.__;
-import org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.aaiclient.client.aai.entities.uri.AAIClientUriFactory;
import org.slf4j.Logger;
});
}
- public VolumeGroup getVolumeGroup(String vnfId, String volumeGroupId) throws AAIEntityNotFound {
+ public VolumeGroup getVolumeGroup(String vnfId, String volumeGroupId) {
AAIResultWrapper wrapper = this.getAaiResourcesClient()
.get(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
.relatedTo(Types.VOLUME_GROUP.getFragment(volumeGroupId)));
* 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.
import org.apache.http.HttpStatus;
import org.junit.Test;
import org.onap.so.apihandlerinfra.BaseTest;
-import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
public class ResponseBuilderTest extends BaseTest {
private ResponseBuilder builder;
@Test
- public void testBuildResponseResponse() throws ApiException {
+ public void testBuildResponseResponse() {
String requestId = null;
String apiVersion = "1";
}
@Test
- public void testBuildResponseVersion() throws ApiException {
+ public void testBuildResponseVersion() {
String requestId = "123456-67889";
String apiVersion = "v5";
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
}
@Test
- public void doNotFailOnUnknownPropertiesTest() throws JsonParseException, JsonMappingException, IOException {
+ public void doNotFailOnUnknownPropertiesTest() throws JsonMappingException, IOException {
wireMockServer.stubFor(get(("/aai/" + AAIVersion.LATEST
+ "/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
-import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
}
@Test
- public void getActivityNameTest() throws IOException {
+ public void getActivityNameTest() {
String expectedActivityName = "Last task executed: BB to Execute";
String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
}
@Test
- public void getActivityNameNullActivityNameTest() throws IOException {
+ public void getActivityNameNullActivityNameTest() {
String expectedActivityName = "Task name is null.";
HistoricActivityInstanceEntity activityInstance = new HistoricActivityInstanceEntity();
List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
}
@Test
- public void getActivityNameNullListTest() throws IOException {
+ public void getActivityNameNullListTest() {
String expectedActivityName = "No results returned on activityInstance history lookup.";
List<HistoricActivityInstanceEntity> activityInstanceList = null;
String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
}
@Test
- public void getActivityNameEmptyListTest() throws IOException {
+ public void getActivityNameEmptyListTest() {
String expectedActivityName = "No results returned on activityInstance history lookup.";
List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
}
@Test
- public void getCamundActivityHistoryNullTest() throws IOException, ContactCamundaException {
+ public void getCamundActivityHistoryNullTest() {
HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
processInstance.setId("c4c6b647-a26e-11e9-b144-0242ac14000b");
List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
}
@Test
- public void getCamundActivityHistoryErrorTest() throws IOException, ContactCamundaException {
+ public void getCamundActivityHistoryErrorTest() {
HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
processInstance.setId("c4c6b647-a26e-11e9-b144-0242ac14000b");
List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
}
@Test
- public void getTaskName() throws IOException, ContactCamundaException {
+ public void getTaskName() {
doReturn(processInstanceResponse).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID,
false, false, true);
doReturn(activityInstanceResponse).when(camundaRequestHandler)
}
@Test
- public void getTaskNameNullProcessInstanceListTest() throws IOException, ContactCamundaException {
+ public void getTaskNameNullProcessInstanceListTest() {
ResponseEntity<List<HistoricProcessInstanceEntity>> response = new ResponseEntity<>(null, HttpStatus.OK);
String actual = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
}
@Test
- public void getTaskNameNullProcessInstanceIdTest() throws IOException, ContactCamundaException {
+ public void getTaskNameNullProcessInstanceIdTest() {
HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
processInstanceList.add(processInstance);
}
@Test
- public void getTaskNameEmptyProcessInstanceListTest() throws IOException, ContactCamundaException {
+ public void getTaskNameEmptyProcessInstanceListTest() {
List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
ResponseEntity<List<HistoricProcessInstanceEntity>> response =
new ResponseEntity<>(processInstanceList, HttpStatus.OK);
}
@Test
- public void getTaskNameProcessInstanceLookupFailureTest() throws IOException, ContactCamundaException {
+ public void getTaskNameProcessInstanceLookupFailureTest() {
doThrow(HttpClientErrorException.class).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID,
false, false, true);
}
@Test
- public void getCamundaActivityHistoryTest() throws IOException, ContactCamundaException {
+ public void getCamundaActivityHistoryTest() {
HttpHeaders headers = setHeaders();
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
String targetUrl =
}
@Test
- public void getCamundaProccesInstanceHistoryTest() throws IOException, ContactCamundaException {
+ public void getCamundaProccesInstanceHistoryTest() {
HttpHeaders headers = setHeaders();
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
String targetUrl = "http://localhost:8089/sobpmnengine/history/process-instance?processInstanceBusinessKey="
}
@Test
- public void getCamundaProccesInstanceHistoryFailThenSuccessTest() throws IOException, ContactCamundaException {
+ public void getCamundaProccesInstanceHistoryFailThenSuccessTest() {
HttpHeaders headers = setHeaders();
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
String targetUrl = "http://localhost:8089/sobpmnengine/history/process-instance?processInstanceBusinessKey="
}
@Test
- public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
+ public void setCamundaHeadersTest() {
String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
String key = "07a7159d3bf51a0e53be7a8f89699be7";
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.client.RestTemplate;
-import com.fasterxml.jackson.core.JsonProcessingException;
@RunWith(SpringRunner.class)
}
@Test
- public void globalHealthcheckAllUPTest() throws JSONException, JsonProcessingException {
+ public void globalHealthcheckAllUPTest() throws JSONException {
HealthCheckResponse expected = new HealthCheckResponse();
import org.springframework.test.context.junit4.rules.SpringMethodRule;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import junitparams.JUnitParamsRunner;
}
@Parameters
- private Collection<Object[]> successParameters() throws JsonParseException, JsonMappingException, IOException {
+ private Collection<Object[]> successParameters() throws JsonMappingException, IOException {
return Arrays.asList(new Object[][] {
{mapper.readValue(inputStream("/CloudConfiguration/EmptyCloudConfiguration.json"),
ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, "3"},
}
@Parameters
- private Collection<Object[]> customWorkflowSuccessParameters()
- throws JsonParseException, JsonMappingException, IOException {
+ private Collection<Object[]> customWorkflowSuccessParameters() throws JsonMappingException, IOException {
return Arrays.asList(
new Object[][] {{mapper.readValue(inputStream("/SuccessfulValidation/v1ExecuteCustomWorkflow.json"),
ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, "1"}
@Test
@Parameters(method = "aLaCarteParameters")
- public void aLaCarteFlagTest(boolean expected, ServiceInstancesRequest sir)
- throws JsonParseException, IOException, ValidationException {
+ public void aLaCarteFlagTest(boolean expected, ServiceInstancesRequest sir) {
this.expected = expected;
this.sir = sir;
this.msoRequest = new MsoRequest();
@Parameters(method = "validationParameters")
public void validationFailureTest(String expectedException, ServiceInstancesRequest sir,
HashMap<String, String> instanceIdMapTest, Action action, int reqVersion)
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ throws IOException, ValidationException {
this.expectedException = expectedException;
this.sir = sir;
this.instanceIdMapTest = instanceIdMapTest;
}
@Test
- public void nullInstanceIdMapTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void nullInstanceIdMapTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/RequestParameters/RequestParametersNull.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest = null;
}
@Test
- public void serviceInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void serviceInstanceIdHashMapFailureTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("serviceInstanceId", "test");
}
@Test
- public void vnfInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void vnfInstanceIdHashMapFailureTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("vnfInstanceId", "test");
}
@Test
- public void vfModuleInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void vfModuleInstanceIdHashMapFailureTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("vfModuleInstanceId", "test");
@Test
public void volumeGroupInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("volumeGroupInstanceId", "test");
}
@Test
- public void networkInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void networkInstanceIdHashMapFailureTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("networkInstanceId", "test");
@Test
public void configurationInstanceIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("configurationInstanceId", "test");
}
@Test
- public void instanceGroupIdHashMapFailureTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void instanceGroupIdHashMapFailureTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("instanceGroupInstanceId", "test");
}
@Test
- public void testVfModuleV4UsePreLoad()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void testVfModuleV4UsePreLoad() throws JsonMappingException, IOException, ValidationException {
this.requestJSON = inputStream("/SuccessfulValidation/v4CreateVfModule.json");
this.instanceIdMapTest.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
this.instanceIdMapTest.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
}
@Test
- public void buildServiceErrorResponseTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void buildServiceErrorResponseTest() throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("serviceInstanceId", "test");
@Test
public void buildServiceErrorPolicyExceptionResponseTest()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ throws JsonMappingException, IOException, ValidationException {
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"),
ServiceInstancesRequest.class);
this.instanceIdMapTest.put("serviceInstanceId", "test");
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.exceptions.ValidationException;
import org.onap.so.serviceinstancebeans.CloudRequestData;
import org.onap.so.serviceinstancebeans.GetOrchestrationListResponse;
import org.onap.so.serviceinstancebeans.GetOrchestrationResponse;
}
@Test
- public void testUnlockOrchestrationRequest_Valid_Status()
- throws JsonParseException, JsonMappingException, IOException, ValidationException {
+ public void testUnlockOrchestrationRequest_Valid_Status() throws IOException {
setupTestUnlockOrchestrationRequest_Valid_Status("5ffbabd6-b793-4377-a1ab-082670fbc7ac", "PENDING");
String requestJSON =
new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/Request.json")));
}
@Test
- public void mapRequestProcessingDataTest() throws JsonParseException, JsonMappingException, IOException {
+ public void mapRequestProcessingDataTest() throws IOException {
RequestProcessingData entry = new RequestProcessingData();
RequestProcessingData secondEntry = new RequestProcessingData();
List<HashMap<String, String>> expectedList = new ArrayList<>();
}
@Test
- public void testThatActiveRequestsExceptionsAreMapped() throws Exception {
+ public void testThatActiveRequestsExceptionsAreMapped() {
String testRequestId = UUID.randomUUID().toString();
wireMockServer.stubFor(any(urlPathEqualTo("/infraActiveRequests/" + testRequestId))
.willReturn(aResponse().withStatus(HttpStatus.SC_UNAUTHORIZED)));
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
-import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.constants.OrchestrationRequestFormat;
import org.onap.so.constants.Status;
}
@Test
- public void mapRequestStatusToRequestForFormatDetailTest() throws ApiException {
+ public void mapRequestStatusToRequestForFormatDetailTest() {
iar.setRequestStatus(Status.ABORTED.toString());
String result =
orchestrationRequests.mapRequestStatusToRequest(iar, OrchestrationRequestFormat.DETAIL.toString());
}
@Test
- public void mapRequestStatusToRequestForFormatStatusDetailTest() throws ApiException {
+ public void mapRequestStatusToRequestForFormatStatusDetailTest() {
iar.setRequestStatus(Status.ABORTED.toString());
String result = orchestrationRequests.mapRequestStatusToRequest(iar, "statusDetail");
@Test
- public void mapRequestStatusToRequestForFormatEmptyStringTest() throws ApiException {
+ public void mapRequestStatusToRequestForFormatEmptyStringTest() {
iar.setRequestStatus(Status.ABORTED.toString());
String result = orchestrationRequests.mapRequestStatusToRequest(iar, StringUtils.EMPTY);
}
@Test
- public void taskNameLookup() throws ContactCamundaException {
+ public void taskNameLookup() {
InfraActiveRequests req = new InfraActiveRequests();
req.setRequestId("70debc2a-d6bc-4795-87ba-38a94d9b0b99");
Instant startInstant = Instant.now().minus(1, ChronoUnit.DAYS);
}
@Test
- public void noCamundaLookupAfterInterval() throws ContactCamundaException {
+ public void noCamundaLookupAfterInterval() {
InfraActiveRequests req = new InfraActiveRequests();
req.setRequestId("70debc2a-d6bc-4795-87ba-38a94d9b0b99");
Instant startInstant = Instant.now().minus(36, ChronoUnit.DAYS);
RequestActionMap test = new RequestActionMap();
@Test
- public void getMappedRequestActionTest() throws Exception {
+ public void getMappedRequestActionTest() {
test.getMappedRequestAction("action");
}
import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
}
@Test
- public void setServiceTypeTestNetwork() throws JsonProcessingException {
+ public void setServiceTypeTestNetwork() {
String requestScope = ModelType.network.toString();
Boolean aLaCarteFlag = null;
ServiceInstancesRequest sir = new ServiceInstancesRequest();
}
@Test
- public void setServiceInstanceIdInstanceGroupTest() throws JsonParseException, JsonMappingException, IOException {
+ public void setServiceInstanceIdInstanceGroupTest() throws JsonMappingException, IOException {
String requestScope = "instanceGroup";
ServiceInstancesRequest sir =
mapper.readValue(inputStream("/CreateInstanceGroup.json"), ServiceInstancesRequest.class);
}
@Test
- public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
+ public void setCamundaHeadersTest() {
String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
String key = "07a7159d3bf51a0e53be7a8f89699be7";
HttpHeaders headers = camundaRequestHandler.setCamundaHeaders(encryptedAuth, key);
currentActiveRequest.setOriginalRequestId(RESUMED_REQUEST_ID);
}
- private void setCurrentActiveRequestNullInfraActive() throws IOException {
+ private void setCurrentActiveRequestNullInfraActive() {
currentActiveRequestIARNull.setRequestId(CURRENT_REQUEST_ID);
currentActiveRequestIARNull.setSource("VID");
currentActiveRequestIARNull.setStartTime(startTimeStamp);
}
@Test
- public void getModelTypeApplyUpdatedConfigTest() throws ApiException {
+ public void getModelTypeApplyUpdatedConfigTest() {
ModelType modelTypeExpected = ModelType.vnf;
ModelType modelTypeResult = requestHandler.getModelType(Action.applyUpdatedConfig, null);
}
@Test
- public void getModelTypeInPlaceSoftwareUpdateTest() throws ApiException {
+ public void getModelTypeInPlaceSoftwareUpdateTest() {
ModelType modelTypeExpected = ModelType.vnf;
ModelType modelTypeResult = requestHandler.getModelType(Action.inPlaceSoftwareUpdate, null);
}
@Test
- public void getModelTypeAddMembersTest() throws ApiException {
+ public void getModelTypeAddMembersTest() {
ModelType modelTypeExpected = ModelType.instanceGroup;
ModelType modelTypeResult = requestHandler.getModelType(Action.addMembers, null);
}
@Test
- public void getModelTypeRemoveMembersTest() throws ApiException {
+ public void getModelTypeRemoveMembersTest() {
ModelType modelTypeExpected = ModelType.instanceGroup;
ModelType modelTypeResult = requestHandler.getModelType(Action.removeMembers, null);
}
@Test
- public void getModelTypeTest() throws ApiException {
+ public void getModelTypeTest() {
ModelType modelTypeExpected = ModelType.service;
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelType(ModelType.service);
@Before
- public void setup() throws ValidateException, IOException {
+ public void setup() throws IOException {
// Setup general requestHandler mocks
when(requestHandler.getRequestUri(any(), anyString())).thenReturn(requestUri);
}
@Test
- public void resumeRequestTest() throws ApiException, IOException {
+ public void resumeRequestTest() throws ApiException {
Response response = null;
doReturn(instanceIdMap).when(resumeReq).setInstanceIdMap(infraActiveRequest, ModelType.service.toString());
doReturn(SERVICE_INSTANCE_NAME).when(resumeReq).getInstanceName(infraActiveRequest,
}
@Test
- public void resumeRequestTestALaCarteNull() throws ApiException, IOException {
+ public void resumeRequestTestALaCarteNull() throws ApiException {
Response response = null;
doReturn(instanceIdMap).when(resumeReq).setInstanceIdMap(infraActiveRequest, ModelType.service.toString());
doReturn(SERVICE_INSTANCE_NAME).when(resumeReq).getInstanceName(infraActiveRequest,
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.util.UriComponentsBuilder;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
}
@Test
- public void setServiceTypeTestNetwork() throws JsonProcessingException {
+ public void setServiceTypeTestNetwork() {
String requestScope = ModelType.network.toString();
Boolean aLaCarteFlag = null;
ServiceInstancesRequest sir = new ServiceInstancesRequest();
}
@Test
- public void setServiceInstanceIdInstanceGroupTest() throws JsonParseException, JsonMappingException, IOException {
+ public void setServiceInstanceIdInstanceGroupTest() throws JsonMappingException, IOException {
String requestScope = "instanceGroup";
ServiceInstancesRequest sir =
mapper.readValue(inputStream("/CreateInstanceGroup.json"), ServiceInstancesRequest.class);
}
@Test
- public void handleReplaceInstance_Test() throws JsonParseException, JsonMappingException, IOException {
+ public void handleReplaceInstance_Test() throws JsonMappingException, IOException {
String replaceVfModule = inputStream("/ReplaceVfModule.json");
ObjectMapper mapper = new ObjectMapper();
ServiceInstancesRequest sir = mapper.readValue(replaceVfModule, ServiceInstancesRequest.class);
}
@Test
- public void handleReplaceInstance_retainAssignments_Test()
- throws JsonParseException, JsonMappingException, IOException {
+ public void handleReplaceInstance_retainAssignments_Test() throws JsonMappingException, IOException {
String replaceVfModule = inputStream("/ReplaceVfModuleRetainAssignments.json");
ObjectMapper mapper = new ObjectMapper();
ServiceInstancesRequest sir = mapper.readValue(replaceVfModule, ServiceInstancesRequest.class);
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import java.io.IOException;
-import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.MediaType;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
private final String basePath = "/onap/so/infra/tasks/v1";
@Test
- public void getTasksTestByOriginalRequestId()
- throws ParseException, JSONException, JsonParseException, JsonMappingException, IOException {
+ public void getTasksTestByOriginalRequestId() throws JSONException, JsonMappingException, IOException {
wireMockServer.stubFor(post(urlPathEqualTo("/sobpmnengine/task"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("Camunda/GetTaskResponse.json").withStatus(HttpStatus.SC_OK)));
package org.onap.so.apihandlerinfra;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
@Test
public void queryWorkflowSpecificationsByVnfModelUUID_Test_Success()
- throws ParseException, JSONException, JsonParseException, JsonMappingException, IOException {
+ throws JSONException, JsonMappingException, IOException {
final String urlPath = basePath + "/v1/workflows";
HttpHeaders headers = new HttpHeaders();
DelE2ESvcResp test = new DelE2ESvcResp();
@Test
- public void verifyDelE2ESvcResp() throws Exception {
+ public void verifyDelE2ESvcResp() {
test.setOperationId("operationId");
assertEquals(test.getOperationId(), "operationId");
}
E2ERequest test = new E2ERequest();
@Test
- public void verifyE2ERequest() throws Exception {
+ public void verifyE2ERequest() {
test.setOperationId("operationId");
assertEquals(test.getOperationId(), "operationId");
E2EServiceInstanceDeleteRequest test = new E2EServiceInstanceDeleteRequest();
@Test
- public void verifyE2ESerInstanceDelReq() throws Exception {
+ public void verifyE2ESerInstanceDelReq() {
test.setGlobalSubscriberId("id");
assertEquals(test.getGlobalSubscriberId(), "id");
E2EUserParam test = new E2EUserParam();
@Test
- public void verifyE2EParam() throws Exception {
+ public void verifyE2EParam() {
test.setName("name");
assertEquals(test.getName(), "name");
@Test
- public void verifyNsParameters() throws Exception {
+ public void verifyNsParameters() {
LocationConstraint obj = new LocationConstraint();
List<LocationConstraint> locationConstraints = new ArrayList<LocationConstraint>();
}
@Test
- public void getVolumeGroupsOfVnfTest() throws Exception {
+ public void getVolumeGroupsOfVnfTest() {
VolumeGroups volumeGroups = getVolumeGroups();
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId"))
.relatedTo(Types.VOLUME_GROUPS.getFragment());
}
@Test
- public void getVolumeGroupsOfVnfWhenNoneTest() throws Exception {
+ public void getVolumeGroupsOfVnfWhenNoneTest() {
VolumeGroups volumeGroups = new VolumeGroups();
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("vnfId"))
.relatedTo(Types.VOLUME_GROUPS.getFragment());
}
@Test
- public void test_mapCloudConfigurationVnf() throws Exception {
+ public void test_mapCloudConfigurationVnf() {
String vnfId = "6fb01019-c3c4-41fe-b307-d1c56850b687";
Map<String, String[]> filters = new HashMap<>();
filters.put("vnfId", new String[] {"EQ", vnfId});
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
-import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Constants;
-import org.onap.so.apihandlerinfra.infra.rest.exception.NoRecipeException;
import org.onap.so.constants.Status;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void test_checkDuplicateRequest() throws MalformedURLException, NoRecipeException {
+ public void test_checkDuplicateRequest() {
ArgumentCaptor<HashMap> instanceIdCaptor = ArgumentCaptor.forClass(HashMap.class);
restHandler.checkDuplicateRequest("serviceInstanceId", "networkId", "instanceName", "requestId");
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).checkInstanceNameDuplicate(
}
@Test
- public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
+ public void test_saveInstanceName() {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
}
@Test
- public void test_createInfraActiveRequestForDelete() throws Exception {
+ public void test_createInfraActiveRequestForDelete() {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
-import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void test_find_service_recipe() throws MalformedURLException, NoRecipeException {
+ public void test_find_service_recipe() throws NoRecipeException {
ServiceRecipe expected = new ServiceRecipe();
expected.setAction("createInstance");
doReturn(expected).when(catalogDbClient)
}
@Test
- public void test_find_service_recipe_default_recipe() throws MalformedURLException, NoRecipeException {
+ public void test_find_service_recipe_default_recipe() throws NoRecipeException {
ServiceRecipe expected = new ServiceRecipe();
expected.setAction("createInstance");
doReturn(null).when(catalogDbClient)
}
@Test
- public void test_find_service_recipe_not_found() throws MalformedURLException, NoRecipeException {
+ public void test_find_service_recipe_not_found() throws NoRecipeException {
ServiceRecipe expected = new ServiceRecipe();
expected.setAction("createInstance");
doReturn(null).when(catalogDbClient)
}
@Test
- public void test_checkDuplicateRequest()
- throws MalformedURLException, NoRecipeException, RequestConflictedException {
+ public void test_checkDuplicateRequest() throws RequestConflictedException {
ArgumentCaptor<HashMap> instanceIdCaptor = ArgumentCaptor.forClass(HashMap.class);
restHandler.checkDuplicateRequest("serviceInstanceId", "instanceName", "requestId");
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).checkInstanceNameDuplicate(
}
@Test
- public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
+ public void test_saveInstanceName() {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
}
@Test
- public void test_createInfraActiveRequestForDelete() throws Exception {
+ public void test_createInfraActiveRequestForDelete() {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
-import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void test_find_vf_module_recipe() throws MalformedURLException, NoRecipeException {
+ public void test_find_vf_module_recipe() throws NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
doReturn(expected).when(catalogDbClient)
}
@Test
- public void test_find_vf_module_recipe_default_recipe() throws MalformedURLException, NoRecipeException {
+ public void test_find_vf_module_recipe_default_recipe() throws NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
doReturn(null).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
}
@Test
- public void test_find_vf_module_recipe_not_found() throws MalformedURLException, NoRecipeException {
+ public void test_find_vf_module_recipe_not_found() throws NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
exceptionRule.expect(NoRecipeException.class);
}
@Test
- public void test_checkDuplicateRequest() throws MalformedURLException, NoRecipeException {
+ public void test_checkDuplicateRequest() {
ArgumentCaptor<HashMap> instanceIdCaptor = ArgumentCaptor.forClass(HashMap.class);
restHandler.checkDuplicateRequest("serviceInstanceId", "vnfId", "vfModuleId", "instanceName", "requestId");
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).checkInstanceNameDuplicate(
}
@Test
- public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
+ public void test_saveInstanceName() {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
}
@Test
- public void test_createInfraActiveRequestForDelete() throws Exception {
+ public void test_createInfraActiveRequestForDelete() {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
-import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Constants;
-import org.onap.so.apihandlerinfra.infra.rest.exception.NoRecipeException;
import org.onap.so.constants.Status;
import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.catalog.beans.ServiceRecipe;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void test_find_vnf_recipe() throws MalformedURLException, NoRecipeException {
+ public void test_find_vnf_recipe() {
ServiceRecipe expected = new ServiceRecipe();
expected.setOrchestrationUri("/mso/async/services/WorkflowActionBB");
Recipe actual = restHandler.findVnfModuleRecipe("testModelId", ModelType.vnf.toString(),
}
@Test
- public void test_checkDuplicateRequest() throws MalformedURLException, NoRecipeException {
+ public void test_checkDuplicateRequest() {
ArgumentCaptor<HashMap> instanceIdCaptor = ArgumentCaptor.forClass(HashMap.class);
restHandler.checkDuplicateRequest("serviceInstanceId", "vnfId", "instanceName", "requestId");
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).checkInstanceNameDuplicate(
}
@Test
- public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
+ public void test_saveInstanceName() {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
}
@Test
- public void test_createInfraActiveRequestForDelete() throws Exception {
+ public void test_createInfraActiveRequestForDelete() {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
-import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Constants;
-import org.onap.so.apihandlerinfra.infra.rest.exception.NoRecipeException;
import org.onap.so.constants.Status;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
private ObjectMapper mapper = new ObjectMapper();
@Test
- public void test_checkDuplicateRequest() throws MalformedURLException, NoRecipeException {
+ public void test_checkDuplicateRequest() {
ArgumentCaptor<HashMap> instanceIdCaptor = ArgumentCaptor.forClass(HashMap.class);
restHandler.checkDuplicateRequest("serviceInstanceId", "vnfId", "volumeGroupId", "instanceName", "requestId");
Mockito.verify(infraActiveRequestsClient, Mockito.times(1)).checkInstanceNameDuplicate(
}
@Test
- public void test_saveInstanceName() throws MalformedURLException, NoRecipeException {
+ public void test_saveInstanceName() {
ServiceInstancesRequest request = createTestRequest();
InfraActiveRequests dbRequest = createDatabaseRecord();
restHandler.saveInstanceName(request, dbRequest);
}
@Test
- public void test_createInfraActiveRequestForDelete() throws Exception {
+ public void test_createInfraActiveRequestForDelete() {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
private HttpHeaders headers = new HttpHeaders();
@Before
- public void setupTestClass() throws Exception {
+ public void setupTestClass() {
wireMockServer.stubFor(post(urlPathEqualTo(getTestUrl(""))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_CREATED)));
}
@Test
- public void testCreateOpEnvObjectMapperError() throws IOException {
+ public void testCreateOpEnvObjectMapperError() {
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
}
@Test
- public void testCreateOpEnvError() throws IOException {
+ public void testCreateOpEnvError() {
String request =
"{\"requestDetails\":{\"requestInfo\":{\"resourceType\":\"operationalEnvironment\",\"instanceName\": \"myOpEnv\",\"source\": \"VID\",\"requestorId\": \"xxxxxx\"},"
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.text.ParseException;
import javax.ws.rs.core.MediaType;
import org.apache.http.HttpStatus;
import org.junit.Before;
HttpHeaders headers = new HttpHeaders();
@Before
- public void setupTestClass() throws Exception {
+ public void setupTestClass() {
wireMockServer.stubFor(post(urlPathEqualTo(getTestUrl(""))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_CREATED)));
}
@Test
- public void testUnlock() throws ParseException {
+ public void testUnlock() {
wireMockServer.stubFor(get(urlPathEqualTo(getTestUrl("requestIdtestUnlock"))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withBody(String.format(getResponseTemplate, "requestIdtestUnlock", "IN_PROGRESS"))
}
@Test
- public void testUnlockComplete() throws ParseException {
+ public void testUnlockComplete() {
wireMockServer.stubFor(get(urlPathEqualTo(getTestUrl("requestIdtestUnlockComplete"))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withBody(String.format(getResponseTemplate, "requestIdtestUnlockComplete", "COMPLETE"))
}
@Test
- public void testGetOperationalEnvSuccess() throws ParseException {
+ public void testGetOperationalEnvSuccess() {
wireMockServer
.stubFor(get(urlPathEqualTo(getTestUrl("90c56827-1c78-4827-bc4d-6afcdb37a51f"))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
}
@Test
- public void testGetOperationalEnvFilterSuccess() throws ParseException {
+ public void testGetOperationalEnvFilterSuccess() {
wireMockServer
.stubFor(get(urlPathEqualTo(getTestUrl("requestIdtestGetOperationalEnvFilterSuccess"))).willReturn(
aResponse().withHeader(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
}
@Test
- public void testGetOperationalEnvFilterException1() throws ParseException {
+ public void testGetOperationalEnvFilterException1() {
InfraActiveRequests iar = new InfraActiveRequests();
iar.setRequestId("requestId-getOpEnvFilterEx1");
iar.setRequestScope("requestScope");
}
@Test
- public void testGetOperationalEnvFilterException2() throws ParseException {
+ public void testGetOperationalEnvFilterException2() {
InfraActiveRequests iar = new InfraActiveRequests();
iar.setRequestId("requestIdFilterException2");
iar.setRequestScope("requestScope");
}
@Test
- public void testSuccess_PATCH() throws ApiException, IOException {
+ public void testSuccess_PATCH() throws IOException {
String path = "/onap/so/infra/modelDistributions/v1/distributions/ff3514e3-5a33-55df-13ab-12abad84e7fa";
ObjectMapper mapper = new ObjectMapper();
Distribution distRequest = mapper.readValue(requestJSON, Distribution.class);
package org.onap.so.apihandlerinfra.tenantisolation.dmaap;
import static org.junit.Assert.assertEquals;
-import java.io.FileNotFoundException;
-import java.io.IOException;
import org.junit.Test;
import org.onap.so.apihandlerinfra.BaseTest;
import org.springframework.beans.factory.annotation.Autowired;
private OperationalEnvironmentPublisher publisher;
@Test
- public void getProperties() throws FileNotFoundException, IOException {
+ public void getProperties() {
assertEquals(
"B3705D6C2D521257CC2422ACCF03B001811ACC49F564DDB3A2CF2A1378B6D35A23CDCB696F2E1EDFBE6758DFE7C74B94F4A7DF84A0E2BB904935AC4D900D5597DF981ADE6CE1FF3AF993BED0",
import static org.junit.Assert.assertEquals;
import java.io.IOException;
-import java.text.ParseException;
import org.junit.Test;
import org.onap.so.apihandlerinfra.BaseTest;
import com.fasterxml.jackson.databind.ObjectMapper;
@Test
- public void verifyasdcCreateoeRequest() throws IOException, ParseException {
+ public void verifyasdcCreateoeRequest() throws IOException {
ObjectMapper mapper = new ObjectMapper();
private AAIClientHelper clientHelper;
@Test
- public void testGetAaiOperationalEnvironmentSuccess() throws Exception {
+ public void testGetAaiOperationalEnvironmentSuccess() {
wireMockServer.stubFor(
get(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
}
@Test
- public void testGetAaiClientObjectBuilder() throws Exception {
+ public void testGetAaiClientObjectBuilder() {
AAIClientObjectBuilder builder = new AAIClientObjectBuilder();
org.onap.aai.domain.yang.OperationalEnvironment operEnv =
builder.buildAAIOperationalEnvironment("Active", request);
}
@Test
- public void testOperationalEnvDistributionStatusDbMethods() throws Exception {
+ public void testOperationalEnvDistributionStatusDbMethods() {
// test insert method
OperationalEnvDistributionStatus distStatus1 = dbHelper.insertRecordToOperationalEnvDistributionStatus(
}
@Test
- public void testOperationalEnvServiceModelStatusDbMethods() throws Exception {
+ public void testOperationalEnvServiceModelStatusDbMethods() {
// test insert method
OperationalEnvServiceModelStatus serviceModelStatus1 = dbHelper.insertRecordToOperationalEnvServiceModelStatus(
"(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-5][0-9a-f]{3}-?[089ab][0-9a-f]{3}-?[0-9a-f]{12}$";
@BeforeClass
- public static void setUp() throws Exception {
+ public static void setUp() {
System.setProperty("mso.config.path", "src/test/resources");
}
@Test
@Transactional
- public void timeStampCreated() throws InterruptedException, NoEntityFoundException {
+ public void timeStampCreated() throws NoEntityFoundException {
SiteStatus found =
repository.findById("test name4").orElseThrow(() -> new NoEntityFoundException("Cannot Find Site"));
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.security.GeneralSecurityException;
import org.junit.Test;
import org.onap.so.utils.CryptoUtils;
}
@Test
- public final void testEncryption() throws GeneralSecurityException {
+ public final void testEncryption() {
String encrypted = CryptoUtils.encryptCloudConfigPassword("password");
assertTrue(encrypted != null);
assertTrue(!encrypted.equals("password"));
private ActivitySpecRepository activitySpecRepository;
@Test
- public void findAllTest() throws Exception {
+ public void findAllTest() {
List<ActivitySpec> activitySpecList = activitySpecRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(activitySpecList));
}
private CloudSiteRepository cloudSiteRepository;
@Test
- public void findByClliAndAicVersionTest() throws Exception {
+ public void findByClliAndAicVersionTest() {
CloudSite cloudSite = cloudSiteRepository.findByClliAndCloudVersion("MDT13", "2.5");
Assert.assertNotNull(cloudSite);
Assert.assertEquals("mtn13", cloudSite.getId());
}
@Test
- public void findAllTest() throws Exception {
+ public void findAllTest() {
List<CloudSite> cloudSiteList = cloudSiteRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(cloudSiteList));
}
private CollectionNetworkResourceCustomizationRepository cnrcRepo;
@Test
- public void findAllTest() throws Exception {
+ public void findAllTest() {
List<CollectionNetworkResourceCustomization> cnrcList = cnrcRepo.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(cnrcList));
}
@Test
- public void findOneByUuidTest() throws Exception {
+ public void findOneByUuidTest() {
CollectionNetworkResourceCustomization cnrc =
cnrcRepo.findOneByModelCustomizationUUID("3bdbb104-ffff-483e-9f8b-c095b3d3068c");
Assert.assertTrue(cnrc != null);
@Test
- public void findAllTest() throws Exception {
+ public void findAllTest() {
List<CvnfcCustomization> cvnfcCustomizationList = cvnfcCustomizationRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(cvnfcCustomizationList));
}
@Test
@Transactional
- public void createAndGetAllTest() throws Exception {
+ public void createAndGetAllTest() {
CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization();
cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
@Test
@Transactional
- public void createAndGetCvnfcCustomizationListTest() throws Exception {
+ public void createAndGetCvnfcCustomizationListTest() {
CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization();
cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
@Test
@Transactional
- public void createAndGetCvnfcCustomizationTest() throws Exception {
+ public void createAndGetCvnfcCustomizationTest() {
CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization();
cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
private ProcessingFlagsRepository processingFlagsRepository;
@Test
- public void findByFlagTest() throws Exception {
+ public void findByFlagTest() {
ProcessingFlags processingFlags = processingFlagsRepository.findByFlag("TESTFLAG");
Assert.assertNotNull(processingFlags);
Assert.assertEquals("TESTENDPOINT", processingFlags.getEndpoint());
private WorkflowRepository workflowRepository;
@Test
- public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception {
+ public void findByArtifactUuid_ValidUuid_ExpectedOutput() {
Workflow workflow = workflowRepository.findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName());
}
@Test
- public void findByVnfResourceModelUUIDTest() throws Exception {
+ public void findByVnfResourceModelUUIDTest() {
List<Workflow> workflows =
workflowRepository.findWorkflowByVnfModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
}
@Test
- public void findBySourceTest() throws Exception {
+ public void findBySourceTest() {
List<Workflow> workflows = workflowRepository.findBySource("sdc");
Assert.assertTrue(workflows != null);
import org.onap.so.client.sniro.beans.SniroConductorRequest;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
import org.springframework.beans.factory.annotation.Autowired;
-import com.fasterxml.jackson.core.JsonProcessingException;
public class SniroClientTestIT extends BaseIntegrationTest {
@Test(expected = Test.None.class)
- public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
+ public void testPostDemands_success() throws BadResponseException {
String mockResponse =
"{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"corys cool\", \"requestStatus\": \"accepted\"}";
}
@Test(expected = BadResponseException.class)
- public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
+ public void testPostDemands_error_failed() throws BadResponseException {
String mockResponse =
"{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
}
@Test(expected = BadResponseException.class)
- public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
+ public void testPostDemands_error_noMessage() throws BadResponseException {
String mockResponse =
"{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
}
@Test(expected = BadResponseException.class)
- public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
+ public void testPostDemands_error_noStatus() throws BadResponseException {
String mockResponse =
"{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
}
@Test(expected = BadResponseException.class)
- public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
+ public void testPostDemands_error_empty() throws BadResponseException {
String mockResponse = "{ }";
wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
}
@Test(expected = Test.None.class)
- public void testPostRelease_success() throws BadResponseException, JsonProcessingException {
+ public void testPostRelease_success() throws BadResponseException {
String mockResponse = "{\"status\": \"success\", \"message\": \"corys cool\"}";
wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
}
@Test(expected = BadResponseException.class)
- public void testPostRelease_error_failed() throws BadResponseException, JsonProcessingException {
+ public void testPostRelease_error_failed() throws BadResponseException {
String mockResponse = "{\"status\": \"failure\", \"message\": \"corys cool\"}";
wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
}
@Test(expected = BadResponseException.class)
- public void testPostRelease_error_noStatus() throws BadResponseException, JsonProcessingException {
+ public void testPostRelease_error_noStatus() throws BadResponseException {
String mockResponse = "{\"status\": \"\", \"message\": \"corys cool\"}";
wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
}
@Test(expected = BadResponseException.class)
- public void testPostRelease_error_noMessage() throws BadResponseException, JsonProcessingException {
+ public void testPostRelease_error_noMessage() throws BadResponseException {
String mockResponse = "{\"status\": \"failure\", \"message\": null}";
wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
}
@Test(expected = BadResponseException.class)
- public void testPostRelease_error_empty() throws BadResponseException, JsonProcessingException {
+ public void testPostRelease_error_empty() throws BadResponseException {
String mockResponse = "{ }";
wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
public class SDNOValidatorImplTest {
@Test
- public void buildRequestDiagnosticTest() throws Exception {
+ public void buildRequestDiagnosticTest() {
SDNOValidatorImpl validator = new SDNOValidatorImpl();
UUID uuid = UUID.randomUUID();
GenericVnf vnf = new GenericVnf();