diff options
Diffstat (limited to 'vid-automation/src/test')
18 files changed, 40 insertions, 21 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java index 9651002b2..962a7860f 100644 --- a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java +++ b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java @@ -18,7 +18,6 @@ import static org.hamcrest.Matchers.matchesPattern; import static vid.automation.test.services.SimulatorApi.retrieveRecordedRequests; import com.fasterxml.jackson.databind.JsonNode; - import java.lang.reflect.Method; import java.net.URI; import java.util.ArrayList; @@ -28,12 +27,15 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Random; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.vid.api.BaseApiTest; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; @@ -234,12 +236,29 @@ public class LoggerFormatTest extends BaseApiTest { } private JsonNode getCheckerResults (String logtype, String logLines){ + + final int MAX_RETRIES = 3; + Map<String, String> params = new HashMap<>(); params.put("format", "raw"); params.put("type", logtype); params.put("component", "vid"); params.put("data", logLines); - return restTemplate.postForObject(logChecker, params, JsonNode.class); + for (int i=0; i< MAX_RETRIES; i++) { + try { + return restTemplate.postForObject(logChecker, params, JsonNode.class); + } catch (RestClientException exception) { //retry for cases that logchecker is not available immediately + logger.error("Failed to call to logChecker try: " + i, exception); + if (i<(MAX_RETRIES-1)) { //no need to sleep on last retry + try { + Thread.sleep((new Random().nextInt(2000) + 1000)); //random sleep between 1-3 seconds + } catch (InterruptedException e) { + ExceptionUtils.rethrow(e); + } + } + } + } + throw new AssertionError("failed to call to logChecker after max retries: "+MAX_RETRIES); } } diff --git a/vid-automation/src/test/resources/VnfGroup/ServiceWithVnfGroupsDeleteRequest.json b/vid-automation/src/test/resources/VnfGroup/ServiceWithVnfGroupsDeleteRequest.json index d1a777028..34805e1d4 100644 --- a/vid-automation/src/test/resources/VnfGroup/ServiceWithVnfGroupsDeleteRequest.json +++ b/vid-automation/src/test/resources/VnfGroup/ServiceWithVnfGroupsDeleteRequest.json @@ -43,6 +43,6 @@ "modelType": "service", "modelVersion": "1.0" }, - "testApi": "VNF_API", + "testApi": "GR_API", "action": "Delete" } diff --git a/vid-automation/src/test/resources/VnfGroup/VnfGroupCreate1Delete1None1Request.json b/vid-automation/src/test/resources/VnfGroup/VnfGroupCreate1Delete1None1Request.json index cb2f2011c..88757da22 100644 --- a/vid-automation/src/test/resources/VnfGroup/VnfGroupCreate1Delete1None1Request.json +++ b/vid-automation/src/test/resources/VnfGroup/VnfGroupCreate1Delete1None1Request.json @@ -208,5 +208,5 @@ "modelVersion": "1.0" }, - "testApi": "VNF_API" + "testApi": "GR_API" } diff --git a/vid-automation/src/test/resources/VnfGroup/deleteServiceWith2VnfGroupsRequest_AndThreeGroupMembers.json b/vid-automation/src/test/resources/VnfGroup/deleteServiceWith2VnfGroupsRequest_AndThreeGroupMembers.json index b7c6dc2a5..7dfe064d0 100644 --- a/vid-automation/src/test/resources/VnfGroup/deleteServiceWith2VnfGroupsRequest_AndThreeGroupMembers.json +++ b/vid-automation/src/test/resources/VnfGroup/deleteServiceWith2VnfGroupsRequest_AndThreeGroupMembers.json @@ -163,7 +163,7 @@ "instanceName": "SERVICE_INSTANCE_NAME", "owningEntityName": null, "rollbackOnFailure": false, - "testApi": "VNF_API", + "testApi": "GR_API", "isALaCarte": true, "vidNotions": { "instantiationUI": "serviceWithVnfGrouping", diff --git a/vid-automation/src/test/resources/VnfGroup/payloadTemplate1VnfGroupWith3MembersRequest.json b/vid-automation/src/test/resources/VnfGroup/payloadTemplate1VnfGroupWith3MembersRequest.json index d6cf636de..5d8843a8c 100644 --- a/vid-automation/src/test/resources/VnfGroup/payloadTemplate1VnfGroupWith3MembersRequest.json +++ b/vid-automation/src/test/resources/VnfGroup/payloadTemplate1VnfGroupWith3MembersRequest.json @@ -182,5 +182,5 @@ "modelType": "service", "modelVersion": "1.0" }, - "testApi": "VNF_API" + "testApi": "GR_API" } diff --git a/vid-automation/src/test/resources/VnfGroup/serviceWithVnfGroupCreateRequest.json b/vid-automation/src/test/resources/VnfGroup/serviceWithVnfGroupCreateRequest.json index bb0334b7a..478c32a64 100644 --- a/vid-automation/src/test/resources/VnfGroup/serviceWithVnfGroupCreateRequest.json +++ b/vid-automation/src/test/resources/VnfGroup/serviceWithVnfGroupCreateRequest.json @@ -64,7 +64,7 @@ "subscriberName": "SILVIA ROBBINS", "owningEntityName": "WayneHolland", "rollbackOnFailure": true, - "testApi": "VNF_API", + "testApi": "GR_API", "isALaCarte": true, "isDirty":true, "action": "Create" diff --git a/vid-automation/src/test/resources/VnfGroup/vnfGroupCreate1VnfGroupAndDelete2VnfGroupsRequest.json b/vid-automation/src/test/resources/VnfGroup/vnfGroupCreate1VnfGroupAndDelete2VnfGroupsRequest.json index 2e0f85ee4..e29471217 100644 --- a/vid-automation/src/test/resources/VnfGroup/vnfGroupCreate1VnfGroupAndDelete2VnfGroupsRequest.json +++ b/vid-automation/src/test/resources/VnfGroup/vnfGroupCreate1VnfGroupAndDelete2VnfGroupsRequest.json @@ -119,5 +119,5 @@ "modelVersion": "1.0" }, - "testApi": "VNF_API" + "testApi": "GR_API" } diff --git a/vid-automation/src/test/resources/VnfGroup/vnfGroupWithExistingAndNewVnfMembers.json b/vid-automation/src/test/resources/VnfGroup/vnfGroupWithExistingAndNewVnfMembers.json index cabdbca38..aeaf6b65d 100644 --- a/vid-automation/src/test/resources/VnfGroup/vnfGroupWithExistingAndNewVnfMembers.json +++ b/vid-automation/src/test/resources/VnfGroup/vnfGroupWithExistingAndNewVnfMembers.json @@ -43,7 +43,7 @@ "subscriptionServiceType": "service-instance-type", "tenantId": null, "tenantName": null, - "testApi": "VNF_API", + "testApi": "GR_API", "validationCounter": 0, "vnfGroups": { "VNF_GROUP1_INSTANCE_ID": { diff --git a/vid-automation/src/test/resources/asyncInstantiation/ServiceTreeForRetry_serviceInstance.json b/vid-automation/src/test/resources/asyncInstantiation/ServiceTreeForRetry_serviceInstance.json index d5b282e89..aa1945f94 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/ServiceTreeForRetry_serviceInstance.json +++ b/vid-automation/src/test/resources/asyncInstantiation/ServiceTreeForRetry_serviceInstance.json @@ -57,7 +57,7 @@ "bulkSize": 1, "rollbackOnFailure": "false", "isALaCarte": true, - "testApi": "VNF_API", + "testApi": "GR_API", "instanceId": "INSTANCE_ID", "action": "None", "trackById": "TRACK_BY_ID", diff --git a/vid-automation/src/test/resources/asyncInstantiation/ServiceWithFailedServiceInstance.json b/vid-automation/src/test/resources/asyncInstantiation/ServiceWithFailedServiceInstance.json index 28761f393..0d840daed 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/ServiceWithFailedServiceInstance.json +++ b/vid-automation/src/test/resources/asyncInstantiation/ServiceWithFailedServiceInstance.json @@ -33,7 +33,7 @@ "subscriptionServiceType": "TYLER SILVIA", "tenantId": "c85f0e80-0636-44a4-8cb2-4ec00d056e79", "tenantName": "Hedvika Wendelin", - "testApi": "VNF_API", + "testApi": "GR_API", "trackById": "TRACK_BY_ID", "vnfGroups": { }, diff --git a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json index d2e1d6d07..15d506b47 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json +++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json @@ -75,7 +75,7 @@ "action": "Create", "instanceId": null, "instanceName": "hvf6arlba007", - "originalName": "vProbe_NC_VNF 0", + "originalName": "024a417d-ca46-40bf-95ce-809c6a269011", "vnfStoreKey": "vProbe_NC_VNF 0", "instanceParams": [ { @@ -169,7 +169,7 @@ }, "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89", "instanceName": "hvf6arlba008", - "originalName": "vProbe_NC_VNF 0", + "originalName": "024a417d-ca46-40bf-95ce-809c6a269011", "vnfStoreKey": "vProbe_NC_VNF 0_1", "action": "Create", "platformName": "xxx1", diff --git a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json index 296ad311c..daccff0be 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json +++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json @@ -45,7 +45,7 @@ }, "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89", "instanceName": "hvf6arlba007", - "originalName": "vProbe_NC_VNF 0", + "originalName": "024a417d-ca46-40bf-95ce-809c6a269011", "action": "Create", "platformName": "xxx1", "lcpCloudRegionId": "hvf6", @@ -123,7 +123,7 @@ }, "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89", "instanceName": "hvf6arlba008", - "originalName": "vProbe_NC_VNF 0", + "originalName": "024a417d-ca46-40bf-95ce-809c6a269011", "action": "Create", "platformName": "xxx1", "lcpCloudRegionId": "hvf6", diff --git a/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarte.json b/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarte.json index 71ba53661..049626681 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarte.json +++ b/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarte.json @@ -20,7 +20,7 @@ "tenantId" : "c85f0e80-0636-44a4-8cb2-4ec00d056e79", "tenantName" : "Hedvika Wendelin", "bulkSize": "1", - "testApi": "VNF_API", + "testApi": "GR_API", "isALaCarte": true } diff --git a/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarteWithVnfGroup.json b/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarteWithVnfGroup.json index 430675256..d458b63c5 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarteWithVnfGroup.json +++ b/vid-automation/src/test/resources/asyncInstantiation/vidRequestCreateALaCarteWithVnfGroup.json @@ -38,7 +38,7 @@ "tenantId" : "c85f0e80-0636-44a4-8cb2-4ec00d056e79", "tenantName" : "Hedvika Wendelin", "bulkSize": "1", - "testApi": "VNF_API", + "testApi": "GR_API", "isALaCarte": true } diff --git a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Vnf.json b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Vnf.json index f6373bfb4..0dc9321fe 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Vnf.json +++ b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Vnf.json @@ -291,5 +291,5 @@ }, "orchStatus": "Active", "modelInavariantId": "6b528779-44a3-4472-bdff-9cd15ec93450", - "testApi": "VNF_API" + "testApi": "GR_API" } diff --git a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDeleteServiceWithVnf.json b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDeleteServiceWithVnf.json index ac5f7faf9..9cbbfceaf 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDeleteServiceWithVnf.json +++ b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDeleteServiceWithVnf.json @@ -67,5 +67,5 @@ "isALaCarte": true, "orchStatus": "Active", "modelInavariantId": "6b528779-44a3-4472-bdff-9cd15ec93450", - "testApi": "VNF_API" + "testApi": "GR_API" }
\ No newline at end of file diff --git a/vid-automation/src/test/resources/registration_to_simulator/body_jsons/mso_request_delete_or_unassign_service_instance.json b/vid-automation/src/test/resources/registration_to_simulator/body_jsons/mso_request_delete_or_unassign_service_instance.json index 3b0204aa7..951eac1fb 100644 --- a/vid-automation/src/test/resources/registration_to_simulator/body_jsons/mso_request_delete_or_unassign_service_instance.json +++ b/vid-automation/src/test/resources/registration_to_simulator/body_jsons/mso_request_delete_or_unassign_service_instance.json @@ -12,7 +12,7 @@ "requestorId": "16807000" }, "requestParameters": { - "testApi": "VNF_API", + "testApi": "GR_API", "aLaCarte": false } } diff --git a/vid-automation/src/test/resources/vrf/vrfServiceCreateRequest.json b/vid-automation/src/test/resources/vrf/vrfServiceCreateRequest.json index a3fcd0e4e..2d7121729 100644 --- a/vid-automation/src/test/resources/vrf/vrfServiceCreateRequest.json +++ b/vid-automation/src/test/resources/vrf/vrfServiceCreateRequest.json @@ -183,7 +183,7 @@ "rollbackOnFailure": true, "aicZoneName": null, "owningEntityName": "WayneHolland", - "testApi": "VNF_API", + "testApi": "GR_API", "modelInfo": { "modelInvariantId": "dfc2c44c-2429-44ca-ae26-1e6dc1f207fb", "modelVersionId": "f028b2e2-7080-4b13-91b2-94944d4c42d8", |