diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java index a77cc11b3..505e9371e 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java @@ -56,8 +56,7 @@ public List findARCapsuleSummaryDtosByCurrentLocation .join(capsule.capsuleSkin, capsuleSkin) .join(capsule.member, member) .where(ST_Contains(mbr, capsule.point).and(capsule.member.id.eq(memberId) - .and(eqCapsuleType(capsuleType))) - .and(capsule.type.eq(CapsuleType.PUBLIC))) + .and(eqCapsuleType(capsuleType)))) .fetch(); } diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java index d4ee5bd00..f3d6a84fd 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java @@ -134,6 +134,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -153,6 +154,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -172,6 +174,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -191,6 +194,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -210,6 +214,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch( c -> c.capsuleType().equals(CapsuleType.PUBLIC) || c.capsuleType().equals(CapsuleType.SECRET) || @@ -233,6 +238,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch( c -> c.capsuleType().equals(CapsuleType.PUBLIC) || c.capsuleType().equals(CapsuleType.SECRET) || @@ -255,6 +261,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> friendCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> c.capsuleType().equals(CapsuleType.PUBLIC)); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -268,11 +275,12 @@ void setup(@Autowired EntityManager entityManager) { //when List capsules = capsuleQueryRepository.findFriendsARCapsulesByCurrentLocation( - friendCapsuleIds, mbr + friendIds, mbr ); //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> friendCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> c.capsuleType().equals(CapsuleType.PUBLIC)); assertThat(capsules).allMatch(c -> mbr.contains(c.point()));