diff options
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java index 416703637f..407956db0e 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogicTest.java @@ -154,7 +154,6 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { assertTrue(createResponse.isLeft()); } - @Test void testCreateServiceWhenGenericTypeHasProperties() { final Service service = createServiceObject(false); @@ -255,8 +254,6 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { actualService.getProperties(), is(expectedService.getProperties())); } - - /* CREATE validations - start ***********************/ // Service name - start @@ -644,7 +641,6 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { fail(); } - private void testProjectCodeTooShort() { Service serviceExist = createServiceObject(false); @@ -701,7 +697,7 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { eitherService.left().value().setArchived(false); Mockito.when(toscaOperationFacade.getToscaElement(Mockito.anyString())).thenReturn(eitherService); final ComponentException actualException = assertThrows(ComponentException.class, () -> bl.deleteServiceAllVersions(serviceId, user)); - assertEquals(actualException.getActionStatus(), ActionStatus.COMPONENT_NOT_ARCHIVED); + assertEquals(ActionStatus.COMPONENT_NOT_ARCHIVED, actualException.getActionStatus()); assertEquals(actualException.getParams()[0], serviceId); } @@ -893,16 +889,16 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { newService.setServiceType(""); resultOfUpdate = bl.validateAndUpdateServiceMetadata(user, currentService, newService, false, new ArrayList<>()); assertThat(resultOfUpdate.isLeft()).isTrue(); - //null is invalid + //null is valid newService.setServiceType(null); resultOfUpdate = bl.validateAndUpdateServiceMetadata(user, currentService, newService, false, new ArrayList<>()); - assertThat(resultOfUpdate.isRight()).isTrue(); + assertThat(resultOfUpdate.isLeft()).isTrue(); } @Test void testCreateDefaultMetadataServiceFunction() { Service currentService = createServiceObject(true); - assertThat(currentService.getServiceFunction()).isEqualTo(""); + assertThat(currentService.getServiceFunction()).isEmpty(); } @Test @@ -933,10 +929,9 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { newService.setServiceFunction(null); resultOfUpdate = bl.validateAndUpdateServiceMetadata(user, currentService, newService, false, new ArrayList<>()); assertThat(resultOfUpdate.isLeft()).isTrue(); - assertThat(updatedService.getServiceFunction()).isEqualTo(""); + assertThat(updatedService.getServiceFunction()).isEmpty(); } - @Test void testServiceFunctionExceedLength() { String serviceName = "Service"; @@ -1096,7 +1091,6 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { return propertyList; } - @Test void testCreateService_withMultitenancyValidTenant_Success() { Assert.assertTrue(MULTITENANCY_ENABLED); @@ -1113,7 +1107,6 @@ class ServiceBusinessLogicTest extends ServiceBusinessLogicBaseTestSetup { assertEqualsServiceObject(createServiceObject(true), createResponse.left().value()); } - @Test void testCreateService_withMultitenancyInvalidTenant_Failure() { Service service = createServiceObject(false); |