@Test
public void whenTaskNameToSaveIsDuplicatedExpectTaskIsNotValid() {

    when(taskTemplateRepository.get(VALID_TASK_NAME))
            .thenReturn(Collections.singletonList(duplicatedTaskTemplate));
    ValidationResult validationResult = taskValidation.isNewNameValid(VALID_TASK_NAME);
    assertThat(validationResult.getValidationStatus(), is(ValidationStatus.INVALID));
    assertThat(validationResult.getValidationInfo(), is(ERROR_MESSAGE_NAME_EXIST));
}