assertTrue(createResponse.isLeft());
}
-
@Test
void testCreateServiceWhenGenericTypeHasProperties() {
final Service service = createServiceObject(false);
actualService.getProperties(), is(expectedService.getProperties()));
}
-
-
/* CREATE validations - start ***********************/
// Service name - start
fail();
}
-
private void testProjectCodeTooShort() {
Service serviceExist = createServiceObject(false);
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);
}
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
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";
return propertyList;
}
-
@Test
void testCreateService_withMultitenancyValidTenant_Success() {
Assert.assertTrue(MULTITENANCY_ENABLED);
assertEqualsServiceObject(createServiceObject(true), createResponse.left().value());
}
-
@Test
void testCreateService_withMultitenancyInvalidTenant_Failure() {
Service service = createServiceObject(false);