diff options
Diffstat (limited to 'asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java')
-rw-r--r-- | asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java index 08e7539b28..24c91935d4 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java @@ -63,13 +63,40 @@ public class ValidateConformanceLevel extends ComponentBaseTest { Service serviceFirstImport = ResponseParser.parseToObjectUsingMapper(createdService.getResponse(), Service.class); Component serviceObject = AtomicOperationUtils.changeComponentState(serviceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft(); - RestResponse apiRes = ComponentRestUtils.validateConformanceLevel(serviceObject.getUniqueId(), user.getUserId()); + RestResponse apiRes = ComponentRestUtils.validateConformanceLevel(serviceObject.getUUID(), user.getUserId()); String result = apiRes.getResponse(); assertTrue(apiRes.getErrorCode() == 200); assertTrue(result.equals("true")); } @Test + public void testValidateServiceConformanceLevelForSecondMajorVersion() throws Exception { + User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); + + ServiceReqDetails service = ElementFactory.getDefaultService(); + RestResponse createdService = ServiceRestUtils.createService(service, user); + BaseRestUtils.checkCreateResponse(createdService); + Service serviceFirstImport = ResponseParser.parseToObjectUsingMapper(createdService.getResponse(), Service.class); + Component serviceObject = AtomicOperationUtils.changeComponentState(serviceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + String uuid1 = serviceObject.getUUID(); + Component service20Object = AtomicOperationUtils.changeComponentState(serviceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft(); + service20Object = AtomicOperationUtils.changeComponentState(service20Object, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + String uuid2 = service20Object.getUUID(); + + assertTrue(uuid1 != uuid2); + + RestResponse apiRes = ComponentRestUtils.validateConformanceLevel(uuid1, user.getUserId()); + String result = apiRes.getResponse(); + assertTrue(apiRes.getErrorCode() == 200); + assertTrue(result.equals("true")); + + apiRes = ComponentRestUtils.validateConformanceLevel(uuid2, user.getUserId()); + result = apiRes.getResponse(); + assertTrue(apiRes.getErrorCode() == 200); + assertTrue(result.equals("true")); + } + + @Test public void testValidateConformanceLevel404() throws Exception { User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); RestResponse apiRes = ComponentRestUtils.validateConformanceLevel("fake-uuid-for-test", user.getUserId()); |