Skip to content

Commit

Permalink
make the first letter of all should's inside @DisplayName Uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Dec 19, 2024
1 parent a550d5c commit 2e167c8
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should create new entity on save()")
@DisplayName("Should create new entity on save()")
@Test
void saveActionShouldSaveNewAction() {
Action action = createAction(null);
Expand All @@ -75,7 +75,7 @@ void saveActionShouldSaveNewAction() {
assertEquals(action.isChecked(), createdAction.isChecked());
}

@DisplayName("should update action on save() when the action has been modified")
@DisplayName("Should update action on save() when the action has been modified")
@Test
void updateActionShouldUpdateAction() {
Action action = createAction(null);
Expand All @@ -90,7 +90,7 @@ void updateActionShouldUpdateAction() {
assertEquals(4, updateAction.getPriority());
}

@DisplayName("should throw exception on save() when the action has already been updated")
@DisplayName("Should throw exception on save() when the action has already been updated")
@Test
void updateActionShouldThrowExceptionWhenAlreadyUpdated() {
createdAction = actionPersistenceService.save(createAction(null));
Expand All @@ -106,15 +106,15 @@ void updateActionShouldThrowExceptionWhenAlreadyUpdated() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should return list of all actions on findAll()")
@DisplayName("Should return list of all actions on findAll()")
@Test
void getAllActionsShouldReturnListOfAllActions() {
List<Action> actions = actionPersistenceService.findAll();

assertEquals(11, actions.size());
}

@DisplayName("should return list of actions from a key result ordered by ascending priority on getActionsByKeyResultIdOrderByPriorityAsc()")
@DisplayName("Should return list of actions from a key result ordered by ascending priority on getActionsByKeyResultIdOrderByPriorityAsc()")
@Test
void getAllActionsByKeyResultIdShouldReturnListOfAllActionsFromThisKeyResultOrderASC() {
List<Action> actions = actionPersistenceService.getActionsByKeyResultIdOrderByPriorityAsc(6L);
Expand All @@ -125,7 +125,7 @@ void getAllActionsByKeyResultIdShouldReturnListOfAllActionsFromThisKeyResultOrde
assertEquals(3, actions.get(2).getPriority());
}

@DisplayName("should return correct action on findById()")
@DisplayName("Should return correct action on findById()")
@Test
void getActionByIdShouldReturnActionProperly() {
Action action = actionPersistenceService.findById(1L);
Expand All @@ -137,7 +137,7 @@ void getActionByIdShouldReturnActionProperly() {
assertEquals(8L, action.getKeyResult().getId());
}

@DisplayName("should delete action on delete()")
@DisplayName("Should delete action on delete()")
@Test
void shouldDeleteActionById() {
Action action = createAction(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should save new objective alignment entity on save()")
@DisplayName("Should save new objective alignment entity on save()")
@Test
void saveAlignmentShouldSaveNewObjectiveAlignment() {
Alignment alignment = createObjectiveAlignment(null);
Expand All @@ -77,7 +77,7 @@ void saveAlignmentShouldSaveNewObjectiveAlignment() {
assertEquals(4L, ((ObjectiveAlignment) createdAlignment).getAlignmentTarget().getId());
}

@DisplayName("should save new key result alignment entity on save()")
@DisplayName("Should save new key result alignment entity on save()")
@Test
void saveAlignmentShouldSaveNewKeyResultAlignment() {
Alignment alignment = createKeyResultAlignment(null);
Expand All @@ -89,7 +89,7 @@ void saveAlignmentShouldSaveNewKeyResultAlignment() {
assertEquals(8L, ((KeyResultAlignment) createdAlignment).getAlignmentTarget().getId());
}

@DisplayName("should update key result alignment entity on save()")
@DisplayName("Should update key result alignment entity on save()")
@Test
void updateAlignmentShouldSaveKeyResultAlignment() {
createdAlignment = alignmentPersistenceService.save(createKeyResultAlignment(null));
Expand All @@ -102,7 +102,7 @@ void updateAlignmentShouldSaveKeyResultAlignment() {
assertEquals(createdAlignment.getVersion() + 1, updatedAlignment.getVersion());
}

@DisplayName("should throw exception on save() when entity was already updated in the mean time")
@DisplayName("Should throw exception on save() when entity was already updated in the mean time")
@Test
void updateAlignmentShouldThrowExceptionWhenAlreadyUpdated() {
createdAlignment = alignmentPersistenceService.save(createKeyResultAlignment(null));
Expand All @@ -119,7 +119,7 @@ void updateAlignmentShouldThrowExceptionWhenAlreadyUpdated() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should return correct list of alignments on findByAlignedObjectiveId()")
@DisplayName("Should return correct list of alignments on findByAlignedObjectiveId()")
@Test
void findByAlignedObjectiveIdShouldReturnListOfAlignments() {
List<Alignment> alignments = alignmentPersistenceService.findByAlignedObjectiveId(4L);
Expand All @@ -128,7 +128,7 @@ void findByAlignedObjectiveIdShouldReturnListOfAlignments() {
alignments.forEach(this::assertAlignment);
}

@DisplayName("should return correct list of key result alignments on findByKeyResultAlignmentId()")
@DisplayName("Should return correct list of key result alignments on findByKeyResultAlignmentId()")
@Test
void findByKeyResultAlignmentIdShouldReturnListOfAlignments() {
List<KeyResultAlignment> alignments = alignmentPersistenceService.findByKeyResultAlignmentId(8L);
Expand All @@ -137,7 +137,7 @@ void findByKeyResultAlignmentIdShouldReturnListOfAlignments() {
assertAlignment(alignments.get(0));
}

@DisplayName("should return correct list of objective alignments on findByObjectiveAlignmentId()")
@DisplayName("Should return correct list of objective alignments on findByObjectiveAlignmentId()")
@Test
void findByObjectiveAlignmentIdShouldReturnListOfAlignments() {
List<ObjectiveAlignment> alignments = alignmentPersistenceService.findByObjectiveAlignmentId(3L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void appendObjectiveShouldReturnObjectiveWhenSecondLevelRole() {
assertEquals(objectiveId, objective.getId());
}

@DisplayName("should return objective on findObjectiveById() when user is has member level role")
@DisplayName("Should return objective on findObjectiveById() when user is has member level role")
@Test
void appendObjectiveShouldReturnObjectiveWhenMemberRole() {
Long objectiveId = 6L;
Expand All @@ -65,7 +65,7 @@ void appendObjectiveShouldReturnObjectiveWhenMemberRole() {
assertEquals(objectiveId, objective.getId());
}

@DisplayName("should return correct overview on getFilteredOverview() when user has first level role and no team ids are supplied")
@DisplayName("Should return correct overview on getFilteredOverview() when user has first level role and no team ids are supplied")
@Test
void appendOverviewShouldReturnObjectiveWhenFirstLevelRoleAndTeamIdsEmpty() {
Long quarterId = 2L;
Expand All @@ -76,7 +76,7 @@ void appendOverviewShouldReturnObjectiveWhenFirstLevelRoleAndTeamIdsEmpty() {
assertEquals(18L, overviews.size());
}

@DisplayName("should return correct overview on getFilteredOverview() when user has second level role")
@DisplayName("Should return correct overview on getFilteredOverview() when user has second level role")
@Test
void appendOverviewShouldReturnObjectiveWhenSecondLevelRole() {
Long quarterId = 2L;
Expand All @@ -87,7 +87,7 @@ void appendOverviewShouldReturnObjectiveWhenSecondLevelRole() {
assertEquals(6L, overviews.size());
}

@DisplayName("should return correct overview on getFilteredOverview() when user has member level role")
@DisplayName("Should return correct overview on getFilteredOverview() when user has member level role")
@Test
void appendOverviewShouldReturnObjectiveWhenMemberRole() {
Long quarterId = 2L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class AuthorizationCriteriaParametersTest {

@DisplayName("should be successful on setParameters() with default authorization user")
@DisplayName("Should be successful on setParameters() with default authorization user")
@Test
void setParametersShouldBeSuccessfulWithDefaultAuthorizationUser() {
// arrange
Expand All @@ -39,7 +39,7 @@ void setParametersShouldBeSuccessfulWithDefaultAuthorizationUser() {
assertEquals(expected, typedQueryMock.getLog());
}

@DisplayName("should be successful on setParameters() when user is okr champion")
@DisplayName("Should be successful on setParameters() when user is okr champion")
@Test
void setParametersShouldBeSuccessfulWhenUserIsOkrChampion() {
// arrange
Expand All @@ -65,7 +65,7 @@ void setParametersShouldBeSuccessfulWhenUserIsOkrChampion() {
assertEquals(expected, typedQueryMock.getLog());
}

@DisplayName("should be successful on setParameters() when team ids or objective query are empty")
@DisplayName("Should be successful on setParameters() when team ids or objective query are empty")
@ParameterizedTest
@MethodSource("provideListAndString")
void setParametersShouldBeSuccessfulWhenTeamIdsOrObjectiveQueryAreEmpty(List<Long> teamIds, String objectiveQuery) {
Expand Down Expand Up @@ -94,7 +94,7 @@ private static Stream<Arguments> provideListAndString() {
Arguments.of(null, ""));
}

@DisplayName("should be successful on setParameters() when team ids and objective query are not empty")
@DisplayName("Should be successful on setParameters() when team ids and objective query are not empty")
@Test
void setParametersShouldBeSuccessfulWhenTeamIdsAndObjectiveQueryAreNotEmpty() {
// arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void updateCompletedShouldSaveCompleted() {
assertEquals(updateCompleted.getComment(), updatedCompleted.getComment());
}

@DisplayName("should throw exception on save() when entity was already updated in the mean time")
@DisplayName("Should throw exception on save() when entity was already updated in the mean time")
@Test
void updateCompletedShouldThrowExceptionWhenAlreadyUpdated() {
createdCompleted = completedPersistenceService.save(createCompleted(null));
Expand All @@ -104,7 +104,7 @@ void updateCompletedShouldThrowExceptionWhenAlreadyUpdated() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should return correct entity on getCompletedByObjectiveId()")
@DisplayName("Should return correct entity on getCompletedByObjectiveId()")
@Test
void getCompletedShouldGetCompletedByObjectiveId() {
Completed savedCompleted = completedPersistenceService.getCompletedByObjectiveId(6L);
Expand All @@ -115,7 +115,7 @@ void getCompletedShouldGetCompletedByObjectiveId() {
savedCompleted.getObjective().getTitle());
}

@DisplayName("should delete entity on deleteById()")
@DisplayName("Should delete entity on deleteById()")
@Test
void deleteByIdShouldDeleteExistingCompletedByObjectiveId() {

Expand All @@ -131,7 +131,7 @@ void deleteByIdShouldDeleteExistingCompletedByObjectiveId() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should throw exception on findById() when id does not exist")
@DisplayName("Should throw exception on findById() when id does not exist")
@Test
void deleteCompletedShouldThrowExceptionWhenCompletedNotFound() {
long noExistentId = getNonExistentId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should save new key result on save()")
@DisplayName("Should save new key result on save()")
@Test
void saveKeyResultShouldSaveNewKeyResult() {
KeyResult keyResult = createKeyResultMetric(null);
Expand All @@ -91,7 +91,7 @@ void saveKeyResultShouldSaveNewKeyResult() {
assertEquals(keyResult.getDescription(), createdKeyResult.getDescription());
}

@DisplayName("should return correct key result on findById()")
@DisplayName("Should return correct key result on findById()")
@Test
void shouldFindKeyResultById() {
KeyResult keyResult = keyResultPersistenceService.findById(3L);
Expand All @@ -100,7 +100,7 @@ void shouldFindKeyResultById() {
assertEquals("Steigern der URS um 25%", keyResult.getTitle());
}

@DisplayName("should throw exception on findById() when id does not exist")
@DisplayName("Should throw exception on findById() when id does not exist")
@Test
void getKeyResultByIdShouldThrowExceptionWhenKeyResultNotFound() {
OkrResponseStatusException exception = assertThrows(OkrResponseStatusException.class,
Expand All @@ -113,7 +113,7 @@ void getKeyResultByIdShouldThrowExceptionWhenKeyResultNotFound() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should throw exception on findById() when id is null")
@DisplayName("Should throw exception on findById() when id is null")
@Test
void getKeyResultByIdShouldThrowExceptionWhenKeyResultIdIsNull() {
OkrResponseStatusException exception = assertThrows(OkrResponseStatusException.class,
Expand All @@ -126,7 +126,7 @@ void getKeyResultByIdShouldThrowExceptionWhenKeyResultIdIsNull() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should only update entity on recreateEntity() when no type change was done")
@DisplayName("Should only update entity on recreateEntity() when no type change was done")
@Test
void recreateEntityShouldUpdateKeyResultNoTypeChange() {
KeyResult keyResult = createKeyResultOrdinal(null);
Expand Down Expand Up @@ -156,7 +156,7 @@ void recreateEntityShouldUpdateKeyResultNoTypeChange() {
createdKeyResult = recreatedKeyResult;
}

@DisplayName("should change type on recreateEntity() when type change was done")
@DisplayName("Should change type on recreateEntity() when type change was done")
@Test
void recreateEntityShouldUpdateKeyResultWithTypeChange() {
KeyResult keyResult = createKeyResultMetric(null);
Expand Down Expand Up @@ -191,7 +191,7 @@ void recreateEntityShouldUpdateKeyResultWithTypeChange() {
createdKeyResult = recreatedKeyResult;
}

@DisplayName("should update key result on updateEntity()")
@DisplayName("Should update key result on updateEntity()")
@Test
void updateEntityShouldUpdateKeyResult() {
KeyResult keyResult = createKeyResultOrdinal(null);
Expand All @@ -211,7 +211,7 @@ void updateEntityShouldUpdateKeyResult() {
assertEquals(createdKeyResult.getModifiedOn(), updatedKeyResult.getModifiedOn());
}

@DisplayName("should throw exception on updateEntity() when entity was already updated in the mean time")
@DisplayName("Should throw exception on updateEntity() when entity was already updated in the mean time")
@Test
void updateEntityShouldThrowExceptionWhenAlreadyUpdated() {
KeyResult keyResult = createKeyResultOrdinal(null);
Expand All @@ -229,15 +229,15 @@ void updateEntityShouldThrowExceptionWhenAlreadyUpdated() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should return list of key results on getKeyResultsByObjective()")
@DisplayName("Should return list of key results on getKeyResultsByObjective()")
@Test
void getKeyResultsByObjectiveShouldReturnListOfKeyResults() {
List<KeyResult> keyResultsByObjective = keyResultPersistenceService.getKeyResultsByObjective(3L);

assertEquals(3, keyResultsByObjective.size());
}

@DisplayName("should delete entity on deleteById()")
@DisplayName("Should delete entity on deleteById()")
@Test
void deleteKeyResultByIdShouldDeleteExistingKeyResult() {
KeyResult keyResult = createKeyResultMetric(null);
Expand All @@ -255,7 +255,7 @@ void deleteKeyResultByIdShouldDeleteExistingKeyResult() {
assertTrue(TestHelper.getAllErrorKeys(expectedErrors).contains(exception.getReason()));
}

@DisplayName("should throw exception on deleteById() when id does not exist")
@DisplayName("Should throw exception on deleteById() when id does not exist")
@Test
void deleteKeyResultShouldThrowExceptionWhenKeyResultNotFound() {
long nonExistentId = getNonExistentId();
Expand Down
Loading

0 comments on commit 2e167c8

Please sign in to comment.