Skip to content

Commit 5b54fda

Browse files
committed
Fixes
1 parent 76a97d4 commit 5b54fda

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

server/src/main/java/com/objectcomputing/checkins/services/volunteering/VolunteeringRelationshipRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ JOIN volunteering_organization AS org USING(organization_id)
2121
AND rel.member_id = :memberId
2222
AND (rel.is_active = TRUE OR :includeDeactivated = TRUE)
2323
AND (org.is_active = TRUE OR :includeDeactivated = TRUE)
24-
ORDER BY rel.start_date, org.name""", nativeQuery = true)
24+
ORDER BY org.name""", nativeQuery = true)
2525
List<VolunteeringRelationship> findByMemberIdAndOrganizationId(UUID memberId, UUID organizationId, boolean includeDeactivated);
2626

2727
@Query(value = """
@@ -31,7 +31,7 @@ JOIN volunteering_organization AS org USING(organization_id)
3131
WHERE rel.member_id = :memberId
3232
AND (rel.is_active = TRUE OR :includeDeactivated = TRUE)
3333
AND (org.is_active = TRUE OR :includeDeactivated = TRUE)
34-
ORDER BY rel.start_date, org.name""", nativeQuery = true)
34+
ORDER BY org.name""", nativeQuery = true)
3535
List<VolunteeringRelationship> findByMemberId(UUID memberId, boolean includeDeactivated);
3636

3737
@Query(value = """
@@ -41,7 +41,7 @@ JOIN volunteering_organization AS org USING(organization_id)
4141
WHERE rel.organization_id = :organizationId
4242
AND (rel.is_active = TRUE OR :includeDeactivated = TRUE)
4343
AND (org.is_active = TRUE OR :includeDeactivated = TRUE)
44-
ORDER BY rel.start_date, org.name""", nativeQuery = true)
44+
ORDER BY org.name""", nativeQuery = true)
4545
List<VolunteeringRelationship> findByOrganizationId(UUID organizationId, boolean includeDeactivated);
4646

4747
@Query(value = """

server/src/test/java/com/objectcomputing/checkins/services/reviews/ReviewAssignmentControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void testGETFindAssignmentsByPeriodIdDefaultAssignments() {
147147
final HttpResponse<Set<ReviewAssignment>> response = client.toBlocking().exchange(request, Argument.setOf(ReviewAssignment.class));
148148

149149
assertNotNull(response.body());
150-
assertEquals(2, Objects.requireNonNull(response.body()).size());
150+
assertEquals(3, Objects.requireNonNull(response.body()).size());
151151
assertTrue(response.body().stream().anyMatch(ra -> ra.getRevieweeId().equals(memberOne.getId())));
152152
assertTrue(response.body().stream().anyMatch(ra -> ra.getRevieweeId().equals(memberTwo.getId())));
153153
assertTrue(response.body().stream().anyMatch(ra -> ra.getRevieweeId().equals(memberThree.getId())));

server/src/test/java/com/objectcomputing/checkins/services/volunteering/VolunteeringRelationshipControllerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,11 @@ void canListAndFilterRelationships() {
227227
VolunteeringRelationship timFoodbankInactive = createVolunteeringRelationship(tim.getId(), foodbank.getId(), LocalDate.now().minusDays(3), null, false);
228228
VolunteeringRelationship sarahFoodbank = createVolunteeringRelationship(sarah.getId(), foodbank.getId(), LocalDate.now().minusDays(10), LocalDate.now());
229229

230-
// Can find all relationships in correct order
230+
// Can find all relationships in alphabetical order by organization name
231231
List<VolunteeringRelationship> allRelationships = relationshipClient.list(memberAuth, null, null, null);
232232
assertEquals(3, allRelationships.size());
233-
assertEquals(List.of(sarahFoodbank.getId(), sarahLiftForLife.getId(), timLiftForLife.getId()), allRelationships.stream().map(VolunteeringRelationship::getId).toList());
233+
assertEquals(List.of(sarahLiftForLife.getId(), timLiftForLife.getId(), sarahFoodbank.getId()),
234+
allRelationships.stream().map(VolunteeringRelationship::getId).toList());
234235

235236
// Can include inactive relationships
236237
List<VolunteeringRelationship> allWithInactiveRelationships = relationshipClient.list(memberAuth, null, null, true);

0 commit comments

Comments
 (0)