Skip to content

Commit

Permalink
Merge pull request #410 from tukcomCD2024/fix/ar_capsules-B-core-#409
Browse files Browse the repository at this point in the history
fix : AR용 주변 캡슐 조회 시 친구 캡슐만 조회되는 버그 #409
  • Loading branch information
GaBaljaintheroom authored May 10, 2024
2 parents fce88b5 + ccc7b86 commit 0b1c22c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public List<NearbyARCapsuleSummaryDto> 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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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()));
Expand All @@ -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()));
Expand All @@ -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()));
Expand All @@ -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) ||
Expand All @@ -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) ||
Expand All @@ -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()));
Expand All @@ -268,11 +275,12 @@ void setup(@Autowired EntityManager entityManager) {

//when
List<NearbyARCapsuleSummaryDto> 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()));
Expand Down

0 comments on commit 0b1c22c

Please sign in to comment.