diff options
author | 2019-08-27 16:01:01 +0300 | |
---|---|---|
committer | 2019-09-09 07:01:36 +0000 | |
commit | e1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (patch) | |
tree | 46be9cdc44cbb475527bc3c43df23d16f7579d29 /vid-automation/src/test/java | |
parent | e25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff) |
Adding feature: Replace vfmodule
Issue-ID: VID-603
Change-Id: I59068a0979d6fb733e4243c8f78921f396dc9d17
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/test/java')
-rw-r--r-- | vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java index b7c6e0e46..6b5b08e2b 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java @@ -43,6 +43,7 @@ import static org.onap.simulator.presetGenerator.presets.ecompportal_att.EcompPo import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertNull; import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; import static vid.automation.test.utils.TestHelper.GET_SERVICE_MODELS_BY_DISTRIBUTION_STATUS; @@ -771,6 +772,33 @@ public class AaiApiTest extends BaseApiAaiTest { response.getBody()); } + @Test + public void getNewestModelVersionByInvariant() throws JsonProcessingException { + String invariantId = "f6342be5-d66b-4d03-a1aa-c82c3094c4ea"; + + SimulatorApi.registerExpectationFromPreset(new PresetAAIModelVersionsByInvariantId(), CLEAR_THEN_SET ); + + String url = uri + + "/aai_get_newest_model_version_by_invariant/" + invariantId; + ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); + + assertTrue(response.toString().contains("the-newest-version")); + } + + @Test + public void getNewestModelVersionByInvariant_modelNotExist_thenEmptyResponse() { + String invariantId = "f6342be5-d66b-4d03-a1aa-c82c3094c4ea"; + + SimulatorApi.registerExpectationFromPreset(new PresetAAIModelVersionsByInvariantId(), CLEAR_THEN_SET ); + + String url = uri + + "/aai_get_newest_model_version_by_invariant/" + "model-not-exist"; + ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); + + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertNull(response.getBody()); + } + private void assertResponse(Object expected, String response) { assertResponse(Configuration.empty(), expected, response); } |