Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring/1171 naming cleanup #1210

Closed
wants to merge 42 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4ebacfa
Refactor naming in backend and in cypress dir in frontend
RandomTannenbaum Dec 17, 2024
98ad480
Fix casing after rebase
RandomTannenbaum Dec 17, 2024
056ff90
Rename variable and test
RandomTannenbaum Dec 18, 2024
0ec929d
Add displayname annotation to each test in architectureTests
ManuelMoeri Dec 18, 2024
e79fb2e
Add displayname annotation to each test in the controller folder
ManuelMoeri Dec 18, 2024
af1d90e
Add displayname annotation to each test in the deserializer folder
ManuelMoeri Dec 18, 2024
fa97f4d
Add displayname annotation to each test in the mapper folder
ManuelMoeri Dec 18, 2024
05b6d67
Add displayname annotation to each test in the models folder
ManuelMoeri Dec 18, 2024
04011c5
Add displayname annotation to each test in the service.validation pac…
MasterEvarior Dec 18, 2024
559bfb8
Refactor naming in components up to overview component
RandomTannenbaum Dec 18, 2024
09f44a2
Add isplayname annotation to each test in the mulitenancy folder
ManuelMoeri Dec 19, 2024
85014a5
Add isplayname annotation to each test in the security folder
ManuelMoeri Dec 19, 2024
eeed326
Add isplayname annotation to each test in the util.quarter folder and…
ManuelMoeri Dec 19, 2024
4a8d07f
Add displayname annotation to each test in the service.persistence pa…
MasterEvarior Dec 19, 2024
8824931
Add displayname annotation to each test in the service.clientconfig p…
MasterEvarior Dec 19, 2024
5318404
Make 'Should' uppercase in display names
MasterEvarior Dec 19, 2024
c3ddc70
Fix displayname annotation for parameterized test in the service.clie…
MasterEvarior Dec 19, 2024
7c21118
Add display names for some business service test classes
MasterEvarior Dec 19, 2024
f463d30
Add display names for some business service test classes
MasterEvarior Dec 19, 2024
fe41dee
Add display names and rename tests in authorization folder
ManuelMoeri Dec 19, 2024
56f83aa
change all businessservices to use displayname annotation to properly…
nevio18324 Dec 19, 2024
4d4d51c
Merge remote-tracking branch 'refs/remotes/origin/refactoring/1171-na…
nevio18324 Dec 19, 2024
5e9a33f
[FM] Automated formating backend
actions-user Dec 19, 2024
3579107
make all businessservice tests start with should
nevio18324 Dec 19, 2024
150d7ca
Merge remote-tracking branch 'refs/remotes/origin/refactoring/1171-na…
nevio18324 Dec 19, 2024
cf9d857
[FM] Automated formating backend
actions-user Dec 19, 2024
a550d5c
change naming of ValidationServiceTests so that all test names start …
nevio18324 Dec 19, 2024
2e167c8
make the first letter of all should's inside @Displayname Uppercase
nevio18324 Dec 19, 2024
e92e6a8
make every test inside ObjectiveValidationServiceTest start with shou…
nevio18324 Dec 19, 2024
38db5fa
make every tests name inside OverviewValidation start with should
nevio18324 Dec 19, 2024
968dfc6
Fix a couple of mistakes in the test naming folders
ManuelMoeri Dec 19, 2024
d7addcc
make every tests name inside QuarterValidationServiceTest start with…
nevio18324 Dec 19, 2024
ed89a4f
Merge remote-tracking branch 'refs/remotes/origin/refactoring/1171-na…
nevio18324 Dec 19, 2024
cd4ab66
Refactor naming in last three components
RandomTannenbaum Dec 20, 2024
ed72e4b
Refactor app/guards
RandomTannenbaum Dec 20, 2024
3309fec
Refactor interceptors and duplicate objective cypress tests
RandomTannenbaum Dec 20, 2024
613f522
Finish renaming of the @DisplayName annotations
ManuelMoeri Dec 20, 2024
7f65fe9
Refactor app/shared/custom
RandomTannenbaum Dec 20, 2024
710fbc5
fix testfiles of services and shared
kcinay055679 Dec 23, 2024
67cc87a
check naming in team-management of everything below new-user
nevio18324 Dec 23, 2024
434d93f
fix naming of team management
kcinay055679 Dec 23, 2024
867ee49
[FM] Automated formating frontend
actions-user Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make 'Should' uppercase in display names
MasterEvarior committed Dec 19, 2024
commit 53184043711c0228a5d2ed8d467aaa525f505408
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should return correct alignment selections on getAlignmentSelectionByQuarterIdAndTeamIdNot()")
@DisplayName("Should return correct alignment selections on getAlignmentSelectionByQuarterIdAndTeamIdNot()")
@Test
void getAlignmentSelectionByQuarterIdAndTeamIdNotShouldReturnAlignmentSelections() {
List<AlignmentSelection> alignmentSelections = alignmentSelectionPersistenceService
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should return objective on findObjectiveById() when user is has first level role")
@DisplayName("Should return objective on findObjectiveById() when user is has first level role")
@Test
void appendObjectiveShouldReturnObjectiveWhenFirstLevelRole() {
Long objectiveId = 5L;
@@ -45,7 +45,7 @@ void appendObjectiveShouldReturnObjectiveWhenFirstLevelRole() {
assertEquals(objectiveId, objective.getId());
}

@DisplayName("should return objective on findObjectiveById() when user is has second level role")
@DisplayName("Should return objective on findObjectiveById() when user is has second level role")
@Test
void appendObjectiveShouldReturnObjectiveWhenSecondLevelRole() {
Long objectiveId = 6L;
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

public class AuthorizationCriteriaTest {

@DisplayName("should be successful on appendObjective() with default authorization user")
@DisplayName("Should be successful on appendObjective() with default authorization user")
@Test
void appendObjectiveShouldBeSuccessfulWithDefaultAuthorizationUser() {
// arrange
@@ -32,7 +32,7 @@ void appendObjectiveShouldBeSuccessfulWithDefaultAuthorizationUser() {
assertEquals(expected, current);
}

@DisplayName("should be successful on appendObjective() when user is okrChampion")
@DisplayName("Should be successful on appendObjective() when user is okrChampion")
@Test
void appendObjectiveShouldBeSuccessfulWhenUserIsOkrChampion() {
// arrange
@@ -76,7 +76,7 @@ private static Stream<Arguments> provideListAndString() {
Arguments.of(null, ""));
}

@DisplayName("should be successful on appendOverview() when team ids and objective query are not empty")
@DisplayName("Should be successful on appendOverview() when team ids and objective query are not empty")
@Test
void appendOverviewShouldBeSuccessfulWhenTeamIdsAndObjectiveQueryAreNotEmpty() {
// arrange
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ void tearDown() {
}

// uses data from V100_0_0__TestData.sql
@DisplayName("should get checkIns by keyResultId and order them by date desc on getCheckInsByKeyResultIdOrderByCheckInDate() ")
@DisplayName("Should get checkIns by keyResultId and order them by date desc on getCheckInsByKeyResultIdOrderByCheckInDate() ")
@Test
void getCheckInsByKeyResultIdOrderByCheckInDateShouldGetCheckInsByKeyResultIdAndOrderThemByDateDesc() {
// act
@@ -57,7 +57,7 @@ private void assertFirstIsCreatedAfterSecond(CheckIn first, CheckIn second) {
}

// uses data from V100_0_0__TestData.sql
@DisplayName("should get last checkIn of keyResult on getLastCheckInOfKeyResult()")
@DisplayName("Should get last checkIn of keyResult on getLastCheckInOfKeyResult()")
@Test
void getLastCheckInOfKeyResultShouldGetLastCheckInOfKeyResult() {
// act
@@ -76,7 +76,7 @@ private void assertLastIsCreatedAfterAllOtherCheckIns(CheckIn last, List<CheckIn
}
}

@DisplayName("should return checkIn on getModelName()")
@DisplayName("Should return checkIn on getModelName()")
@Test
void getModelNameShouldReturnCheckIn() {
assertEquals(CHECK_IN, checkInPersistenceService.getModelName());
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should save entity on save()")
@DisplayName("Should save entity on save()")
@Test
void saveCompletedShouldSaveCompleted() {
createdCompleted = completedPersistenceService.save(createCompleted(null));
@@ -73,7 +73,7 @@ void saveCompletedShouldSaveCompleted() {
assertEquals(OBJECTIVE_TITLE, createdCompleted.getObjective().getTitle());
}

@DisplayName("should update entity on save() when the entity already exists")
@DisplayName("Should update entity on save() when the entity already exists")
@Test
void updateCompletedShouldSaveCompleted() {
createdCompleted = completedPersistenceService.save(createCompleted(null));
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should return correct objective on findObjectiveById()")
@DisplayName("Should return correct objective on findObjectiveById()")
@Test
void shouldFindObjectiveById() {
// act
@@ -86,7 +86,7 @@ void shouldFindObjectiveById() {
assertObjective(ID_OF_OBJECTIVE_3, TITLE_OF_OBJECTIVE_3, objective);
}

@DisplayName("should throw exception on findObjectiveById() when objective not found")
@DisplayName("Should throw exception on findObjectiveById() when objective not found")
@Test
void findObjectiveByIdShouldThrowExceptionWhenObjectiveNotFound() {
// act
@@ -98,7 +98,7 @@ void findObjectiveByIdShouldThrowExceptionWhenObjectiveNotFound() {
assertResponseStatusException(UNAUTHORIZED, expectedErrors, exception);
}

@DisplayName("should throw exception on findObjectiveById() when objective id is null")
@DisplayName("Should throw exception on findObjectiveById() when objective id is null")
@Test
void findObjectiveByIdShouldThrowExceptionWhenObjectiveIdIsNull() {
// act
@@ -110,7 +110,7 @@ void findObjectiveByIdShouldThrowExceptionWhenObjectiveIdIsNull() {
assertResponseStatusException(BAD_REQUEST, expectedErrors, exception);
}

@DisplayName("should return correct objective on findObjectiveByKeyResultId()")
@DisplayName("Should return correct objective on findObjectiveByKeyResultId()")
@Test
void shouldFindObjectiveByKeyResultId() {
// act
@@ -121,7 +121,7 @@ void shouldFindObjectiveByKeyResultId() {
assertObjective(ID_OF_OBJECTIVE_3, TITLE_OF_OBJECTIVE_3, objective);
}

@DisplayName("should throw exception on findObjectiveByKeyResultId() when objective not found")
@DisplayName("Should throw exception on findObjectiveByKeyResultId() when objective not found")
@Test
void findObjectiveByKeyResultIdShouldThrowExceptionWhenObjectiveNotFound() {
// act
@@ -133,7 +133,7 @@ void findObjectiveByKeyResultIdShouldThrowExceptionWhenObjectiveNotFound() {
assertResponseStatusException(UNAUTHORIZED, expectedErrors, exception);
}

@DisplayName("should throw exception on findObjectiveByKeyResultId() when objective id is null")
@DisplayName("Should throw exception on findObjectiveByKeyResultId() when objective id is null")
@Test
void findObjectiveByKeyResultIdShouldThrowExceptionWhenObjectiveIdIsNull() {
// act
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should return single entity on findById() when entity with id exists")
@DisplayName("Should return single entity on findById() when entity with id exists")
@Test
void findByIdShouldReturnSingleEntityIfEntityWithIdExists() {
var foundUser = persistenceBase.findById(USER_PACO_ID);
@@ -65,7 +65,7 @@ void findByIdShouldReturnSingleEntityIfEntityWithIdExists() {
assertUser("Paco", "Eggimann", "peggimann@puzzle.ch", foundUser);
}

@DisplayName("should throw exception on findById() when entity with id does not exist")
@DisplayName("Should throw exception on findById() when entity with id does not exist")
@Test
void findByIdShouldThrowExceptionIfEntityWithIdDoesNotExist() {
var exception = assertThrows(ResponseStatusException.class,
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ void tearDown() {
TenantContext.setCurrentTenant(null);
}

@DisplayName("should return current, future and GJForTests quarter on getMostCurrentQuarters()")
@DisplayName("Should return current, future and GJForTests quarter on getMostCurrentQuarters()")
@Test
void getMostCurrentQuartersShouldReturnCurrentQuarterAndFutureQuarterAndGJForTestsQuarter() {
List<Quarter> quarterListFromFunction = quarterPersistenceService.getMostCurrentQuarters();
@@ -57,7 +57,7 @@ private void assertCurrentQuarterIsFoundOnce(List<Quarter> quarters) {
assertEquals(1, foundCurrentQuartersCount);
}

@DisplayName("should return current quarter on getCurrentQuarter()")
@DisplayName("Should return current quarter on getCurrentQuarter()")
@Test
void shouldGetCurrentQuarter() {
Quarter quarter = quarterPersistenceService.getCurrentQuarter();
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ void setUp() {
}

// uses data from V100_0_0__TestData.sql
@DisplayName("should return teams with matching name on findTeamsByName()")
@DisplayName("Should return teams with matching name on findTeamsByName()")
@Test
void findTeamsByNameShouldReturnTeamsWithMatchingName() {
List<Team> teams = teamPersistenceService.findTeamsByName("LoremIpsum");
@@ -36,7 +36,7 @@ void findTeamsByNameShouldReturnTeamsWithMatchingName() {
assertEquals("LoremIpsum", teams.get(0).getName());
}

@DisplayName("should return team on getModelName()")
@DisplayName("Should return team on getModelName()")
@Test
void getModelNameShouldReturnTeam() {
assertEquals(TEAM, teamPersistenceService.getModelName());
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ public class UserTeamPersistenceServiceIT {
TenantContext.setCurrentTenant(TestHelper.SCHEMA_PITC);
}

@DisplayName("should remove single user from team on delete()")
@DisplayName("Should remove single user from team on delete()")
@Test
@Transactional
void deleteShouldRemoveSingleUserFromTeam() {
@@ -56,7 +56,7 @@ void deleteShouldRemoveSingleUserFromTeam() {
assertUserIsRemovedFromTeam(ID_OF_USER_ALICE, ID_OF_TEAM_LOREM, 2);
}

@DisplayName("should remove list of users from team on deleteAll()")
@DisplayName("Should remove list of users from team on deleteAll()")
@Test
@Transactional
void deleteAllShouldRemoveListOfUsersFromTeam() {
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ void setUp() {
Mockito.lenient().when(actionPersistenceService.getModelName()).thenReturn("Action");
}

@DisplayName("should be successful on validateOnCreate() when action is valid")
@DisplayName("Should be successful on validateOnCreate() when action is valid")
@Test
void validateOnCreateShouldBeSuccessfulWhenActionIsValid() {
validator.validateOnCreate(action1);
@@ -117,7 +117,7 @@ void validateOnCreateShouldBeSuccessfulWhenActionIsValid() {
verify(validator, times(1)).validate(action1);
}

@DisplayName("should throw exception on validateOnCreate() when model is null")
@DisplayName("Should throw exception on validateOnCreate() when model is null")
@Test
void validateOnCreateShouldThrowExceptionWhenModelIsNull() {
// arrange
@@ -130,7 +130,7 @@ void validateOnCreateShouldThrowExceptionWhenModelIsNull() {
assertOkrResponseStatusException(exception, expectedErrors);
}

@DisplayName("should be successful on validateOnCreate() when id is not null")
@DisplayName("Should be successful on validateOnCreate() when id is not null")
@Test
void validateOnCreateShouldThrowExceptionWhenIdIsNotNull() {
// arrange
@@ -157,7 +157,7 @@ void validateOnCreateShouldThrowExceptionWhenActionIsInvalid(String actionText,
assertOkrResponseStatusException(exception, errors);
}

@DisplayName("should throw exception on validateOnCreate() when attributes are missing")
@DisplayName("Should throw exception on validateOnCreate() when attributes are missing")
@Test
void validateOnCreateShouldThrowExceptionWhenAttrsAreMissing() {
// arrange
@@ -173,7 +173,7 @@ void validateOnCreateShouldThrowExceptionWhenAttrsAreMissing() {
assertOkrResponseStatusException(exception, expectedErrors);
}

@DisplayName("should be successful on validateOnUpdate() when action is valid")
@DisplayName("Should be successful on validateOnUpdate() when action is valid")
@Test
void validateOnUpdateShouldBeSuccessfulWhenActionIsValid() {
// arrange
@@ -191,7 +191,7 @@ void validateOnUpdateShouldBeSuccessfulWhenActionIsValid() {
verify(validator, times(1)).validate(action2);
}

@DisplayName("should throw exception on validateOnUpdate() when model is null")
@DisplayName("Should throw exception on validateOnUpdate() when model is null")
@Test
void validateOnUpdateShouldThrowExceptionWhenModelIsNull() {
// arrange
@@ -204,7 +204,7 @@ void validateOnUpdateShouldThrowExceptionWhenModelIsNull() {
assertOkrResponseStatusException(exception, expectedErrors);
}

@DisplayName("should throw exception on validateOnUpdate() when id is null")
@DisplayName("Should throw exception on validateOnUpdate() when id is null")
@Test
void validateOnUpdateShouldThrowExceptionWhenIdIsNull() {
// act + assert
@@ -219,7 +219,7 @@ void validateOnUpdateShouldThrowExceptionWhenIdIsNull() {
assertOkrResponseStatusException(exception, expectedErrors);
}

@DisplayName("should throw exception on validateOnUpdate() when id has changed")
@DisplayName("Should throw exception on validateOnUpdate() when id has changed")
@Test
void validateOnUpdateShouldThrowExceptionWhenIdHasChanged() {
// act + assert
@@ -235,7 +235,7 @@ void validateOnUpdateShouldThrowExceptionWhenIdHasChanged() {
assertOkrResponseStatusException(exception, expectedErrors);
}

@DisplayName("should throw exception on validateOnUpdate() when no entity can be found")
@DisplayName("Should throw exception on validateOnUpdate() when no entity can be found")
@Test
void validateOnUpdateShouldThrowExceptionWhenEntityDoesNotExist() {
// arrange
@@ -255,7 +255,7 @@ void validateOnUpdateShouldThrowExceptionWhenEntityDoesNotExist() {
assertEquals("MODEL_WITH_ID_NOT_FOUND", exception.getReason());
}

@DisplayName("should throw exception on validateOnUpdate() when KeyResult is not set")
@DisplayName("Should throw exception on validateOnUpdate() when KeyResult is not set")
@ParameterizedTest
@MethodSource("actionPairArgument")
void validateOnUpdateShouldThrowExceptionWhenKeyResultNotSet(ActionPair actionPair) {
Original file line number Diff line number Diff line change
@@ -34,13 +34,13 @@ class AlignmentValidationServiceTest {
@InjectMocks
private AlignmentValidationService validator;

@DisplayName("should throw exception on validateOnCreate()")
@DisplayName("Should throw exception on validateOnCreate()")
@Test
void validateOnCreateShouldThrowException() {
assertThrows(UnsupportedOperationException.class, () -> validator.validateOnCreate(keyResultAlignment));
}

@DisplayName("should throw exception on validateOnUpdate() when id is null")
@DisplayName("Should throw exception on validateOnUpdate() when id is null")
@Test
void validateOnUpdateShouldThrowExceptionWhenIdIsNull() {
when(alignmentPersistenceService.getModelName()).thenReturn("Alignment");
@@ -54,7 +54,7 @@ void validateOnUpdateShouldThrowExceptionWhenIdIsNull() {
verify(validator, times(1)).throwExceptionWhenIdIsNull(null);
}

@DisplayName("should throw exception on validateOnUpdate() when id of alignment is null")
@DisplayName("Should throw exception on validateOnUpdate() when id of alignment is null")
@Test
void validateOnUpdateShouldThrowExceptionWhenIdOfAlignmentIsNull() {
when(alignmentPersistenceService.getModelName()).thenReturn("Alignment");
@@ -70,7 +70,7 @@ void validateOnUpdateShouldThrowExceptionWhenIdOfAlignmentIsNull() {

}

@DisplayName("should throw exception on validateOnUpdate() when id has changed")
@DisplayName("Should throw exception on validateOnUpdate() when id has changed")
@Test
void validateOnUpdateShouldThrowExceptionWhenIdHasChanged() {
Alignment alignment = KeyResultAlignment.Builder.builder().withId(3L).build();
@@ -84,7 +84,7 @@ void validateOnUpdateShouldThrowExceptionWhenIdHasChanged() {
verify(validator, times(1)).throwExceptionWhenIdHasChanged(1L, 3L);
}

@DisplayName("should throw exception on validateOnUpdate() when model is invalid")
@DisplayName("Should throw exception on validateOnUpdate() when model is invalid")
@Test
void validateOnUpdateShouldValidateDto() {
when(alignmentPersistenceService.getModelName()).thenReturn("Alignment");
Loading