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

[BE] Feat/#587 핀 댓글 기능 추가 구현 #601

Merged
merged 36 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
110e964
feat: 핀 댓글 뼈대 코드 작성
kpeel5839 Oct 16, 2023
f5685c0
refactor: 핀 Comment Exception 수정
kpeel5839 Oct 16, 2023
6fe015d
feat: 현재 유저가 해당 pin 에다가 댓글을 작성할 수 있는지 확인하는 메서드 추가
kpeel5839 Oct 16, 2023
cc717f0
feat: 댓글 생성 API 구현
kpeel5839 Oct 16, 2023
c39f04a
feat: 댓글 조회 API 구현
kpeel5839 Oct 16, 2023
4a7424d
refactor: PinResponseComment 에서 Parent, Child Comment 로 메서드 분리
kpeel5839 Oct 16, 2023
843e577
feat: 핀 댓글 수정, 삭제 API 구현
kpeel5839 Oct 16, 2023
efa640d
refactor: 어드민은 Comment 에 대한 모든 권한을 가지도록 수정
kpeel5839 Oct 16, 2023
04fb540
refactor: @OnDelete 를 추가함으로써 DDL 에 외래키 제약 조건 설정에 on Delete Cascade 집어넣기
kpeel5839 Oct 17, 2023
20dd07a
fix: canChange 여부 로직 수정
kpeel5839 Oct 17, 2023
dd701c0
test: 댓글 조회 통합 테스트 작성
kpeel5839 Oct 17, 2023
7741412
test: 댓글 생성 통합 테스트 작성
kpeel5839 Oct 17, 2023
d160dd2
test: 댓글 수정 통합 테스트 작성
kpeel5839 Oct 17, 2023
48b5c4b
test: 댓글 삭제 통합 테스트 작성
kpeel5839 Oct 17, 2023
8b98dfa
docs: 댓글 생성 문서 작성
kpeel5839 Oct 17, 2023
d6a5816
docs: 댓글 조회 문서 작성
kpeel5839 Oct 17, 2023
4d6cff1
docs: 댓글 수정 및 삭제 문서 작성
kpeel5839 Oct 17, 2023
efc2d0e
test: pinComment 생성, 수정 테스트
kpeel5839 Oct 17, 2023
f4e6416
refactor: 핀 댓글 읽기 권한 필터링 추가
kpeel5839 Oct 17, 2023
8a96d6e
test: 핀 댓글 조회 테스트 추가
kpeel5839 Oct 17, 2023
7b6cf26
test: 핀 댓글 생성 테스트 추가
kpeel5839 Oct 17, 2023
c66802a
test: 핀 수정 테스트 추가
kpeel5839 Oct 17, 2023
166b875
test: 핀 삭제 테스트 추가
kpeel5839 Oct 17, 2023
807d15d
style: 개행 조정
kpeel5839 Oct 17, 2023
26bead6
refactor: 정적 팩토리 메서드로 댓글 or 대댓글 나눔
kpeel5839 Oct 18, 2023
909ebf4
refactor: parent, child comment 분기로 인한 중복코드 제거
kpeel5839 Oct 18, 2023
d2d2fa5
refactor: PinIntegrationTest 개행 수정 및 변수명 수정
kpeel5839 Oct 18, 2023
4245228
refactor: EOF 추가
kpeel5839 Oct 18, 2023
38e35fd
refactor: Rest 하게 URI 변경
kpeel5839 Oct 18, 2023
c179ae0
refactor: PinCommandService Parameter 순서 변경
kpeel5839 Oct 18, 2023
97f5ea7
refactor: isGroup -> hasPermission 으로 변경
kpeel5839 Oct 18, 2023
b30b387
style: 공백 제거
kpeel5839 Oct 18, 2023
cd75da7
refactor: @DisplayName 에 개발 용어 대신 도메인 용어를 사용하도록 수정
kpeel5839 Oct 18, 2023
937a63d
refactor: 핀 대대댓글을 달 수 없도록 수정
kpeel5839 Oct 18, 2023
1232bf7
fix: 핀 댓글 조회 통합테스트 예외발생하는 문제 수정
kpeel5839 Oct 18, 2023
fb43e32
fix: git 충돌 해결
kpeel5839 Oct 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ public boolean isGuest() {
return false;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public boolean isGuest() {
return true;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.mapbefine.mapbefine.auth.domain.member;

import com.mapbefine.mapbefine.auth.domain.AuthMember;
import com.mapbefine.mapbefine.topic.domain.Publicity;
import com.mapbefine.mapbefine.topic.domain.Topic;
import com.mapbefine.mapbefine.topic.domain.TopicStatus;
import java.util.List;
Expand All @@ -23,12 +22,14 @@ public User(
@Override
public boolean canRead(Topic topic) {
TopicStatus topicStatus = topic.getTopicStatus();
return topicStatus.isPublic() || isGroup(topic.getId());

return topicStatus.isPublic() || hasPermission(topic.getId());
}

@Override
public boolean canDelete(Topic topic) {
TopicStatus topicStatus = topic.getTopicStatus();

return topicStatus.isPrivate() && isCreator(topic.getId());
}

Expand All @@ -40,14 +41,13 @@ public boolean canTopicUpdate(Topic topic) {
@Override
public boolean canPinCreateOrUpdate(Topic topic) {
TopicStatus topicStatus = topic.getTopicStatus();

return topicStatus.isAllMembers() || hasPermission(topic.getId());
}

@Override
public boolean canPinCommentCreate(Topic topic) {
Publicity publicity = topic.getPublicity();

return publicity == Publicity.PUBLIC || isGroup(topic.getId());
return canRead(topic);
}

@Override
Expand All @@ -69,12 +69,8 @@ private boolean isCreator(Long topicId) {
return createdTopic.contains(topicId);
}

private boolean isGroup(Long topicId) {
return isCreator(topicId) || hasPermission(topicId);
}

private boolean hasPermission(Long topicId) {
return createdTopic.contains(topicId) || topicsWithPermission.contains(topicId);
return isCreator(topicId) || topicsWithPermission.contains(topicId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ public class PinCommandService {

private static final double DUPLICATE_LOCATION_DISTANCE_METERS = 10.0;

private final ImageService imageService;
private final PinRepository pinRepository;
private final LocationRepository locationRepository;
private final TopicRepository topicRepository;
private final MemberRepository memberRepository;
private final PinImageRepository pinImageRepository;
private final ImageService imageService;
private final PinCommentRepository pinCommentRepository;

public PinCommandService(
ImageService imageService,
PinRepository pinRepository,
LocationRepository locationRepository,
TopicRepository topicRepository,
MemberRepository memberRepository,
PinImageRepository pinImageRepository,
ImageService imageService,
PinCommentRepository pinCommentRepository
) {
this.imageService = imageService;
this.pinRepository = pinRepository;
this.locationRepository = locationRepository;
this.topicRepository = topicRepository;
this.memberRepository = memberRepository;
this.pinImageRepository = pinImageRepository;
this.imageService = imageService;
this.pinCommentRepository = pinCommentRepository;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3. 필드 순서, 생성자 파라미터 순서에서 Service와 Repository를 분류하면 어떨까요?
Repository가 다음에 추가될 확률이 더 높으니 ImageService를 첫번째 파라미터, 필드로 올려도 좋을 것 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영하겠습니다~!


Expand Down Expand Up @@ -211,9 +211,12 @@ public Long savePinComment(AuthMember authMember, PinCommentCreateRequest reques
Pin pin = findPin(request.pinId());
validatePinCommentCreate(authMember, pin);
Member member = findMember(authMember.getMemberId());
PinComment parentPinComment = findParentPinComment(request.parentPinCommentId());

PinComment pinComment = PinComment.of(pin, parentPinComment, member, request.content());
PinComment pinComment = createPinComment(
pin,
member,
request.parentPinCommentId(),
request.content()
);
pinCommentRepository.save(pinComment);

return pinComment.getId();
Expand All @@ -227,13 +230,19 @@ private void validatePinCommentCreate(AuthMember authMember, Pin pin) {
throw new PinCommentForbiddenException(FORBIDDEN_PIN_COMMENT_CREATE);
}

private PinComment findParentPinComment(Long parentPinComment) {
if (Objects.isNull(parentPinComment)) {
return null;
private PinComment createPinComment(
Pin pin,
Member member,
Long parentPinCommentId,
String content
) {
if (Objects.isNull(parentPinCommentId)) {
return PinComment.ofParentPinComment(pin, member, content);
}

return pinCommentRepository.findById(parentPinComment)
.orElseThrow(() -> new PinCommentNotFoundException(PIN_COMMENT_NOT_FOUND, parentPinComment));
PinComment parentPinComment = findPinComment(parentPinCommentId);

return PinComment.ofChildPinComment(pin, parentPinComment, member, content);
}

public void updatePinComment(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public List<PinResponse> findAllPinsByMemberId(AuthMember authMember, Long membe
.toList();
}

public List<PinCommentResponse> findAllPinCommentByPinId(AuthMember member, Long pinId) {
public List<PinCommentResponse> findAllPinCommentsByPinId(AuthMember member, Long pinId) {
Pin pin = findPin(pinId);
validateReadAuth(member, pin.getTopic());

List<PinComment> pinComments = pinCommentRepository.findAllByPinId(pinId);

return pinComments.stream()
.map(pinComment -> pinCommentToResponse(member, pinComment))
.map(pinComment -> PinCommentResponse.of(pinComment, isCanChangePinComment(member, pinComment)))
.toList();
}

Expand All @@ -79,18 +79,12 @@ private Pin findPin(Long pinId) {
.orElseThrow(() -> new PinNotFoundException(PIN_NOT_FOUND, pinId));
}

private PinCommentResponse pinCommentToResponse(AuthMember member, PinComment pinComment) {
private boolean isCanChangePinComment(AuthMember member, PinComment pinComment) {
Long creatorId = pinComment.getCreator().getId();

boolean canChange = (Objects.nonNull(member.getMemberId())
return (Objects.nonNull(member.getMemberId())
&& member.isSameMember(creatorId))
|| member.isAdmin();

if (pinComment.isParentComment()) {
return PinCommentResponse.ofParentComment(pinComment, canChange);
}

return PinCommentResponse.ofChildComment(pinComment, canChange);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.mapbefine.mapbefine.pin.exception.PinCommentErrorCode.ILLEGAL_CONTENT_LENGTH;
import static com.mapbefine.mapbefine.pin.exception.PinCommentErrorCode.ILLEGAL_CONTENT_NULL;
import static com.mapbefine.mapbefine.pin.exception.PinCommentErrorCode.ILLEGAL_PIN_COMMENT_DEPTH;
import static lombok.AccessLevel.PROTECTED;

import com.mapbefine.mapbefine.common.entity.BaseTimeEntity;
Expand All @@ -16,6 +17,7 @@
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import java.util.Objects;
import java.util.Optional;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.OnDelete;
Expand Down Expand Up @@ -49,7 +51,7 @@ public class PinComment extends BaseTimeEntity {
@Column(nullable = false, length = 1000)
private String content;

public PinComment(
private PinComment(
Pin pin,
PinComment parentPinComment,
Member creator,
Expand All @@ -61,17 +63,37 @@ public PinComment(
this.content = content;
}

public static PinComment of(
public static PinComment ofParentPinComment(
Pin pin,
Member creator,
String content
) {
validateContent(content);

return new PinComment(pin, null, creator, content);
}

public static PinComment ofChildPinComment(
Pin pin,
PinComment parentPinComment,
Member creator,
String content
) {
validatePinCommentDepth(parentPinComment);
validateContent(content);


return new PinComment(pin, parentPinComment, creator, content);
}

private static void validatePinCommentDepth(PinComment parentPinComment) {
if (parentPinComment.isParentComment()) {
return;
}

throw new PinCommentBadRequestException(ILLEGAL_PIN_COMMENT_DEPTH);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

private static void validateContent(String content) {
if (Objects.isNull(content)) {
throw new PinCommentBadRequestException(ILLEGAL_CONTENT_NULL);
Expand All @@ -90,4 +112,9 @@ public boolean isParentComment() {
return Objects.isNull(parentPinComment);
}

public Optional<Long> getParentPinCommentId() {
return Optional.ofNullable(parentPinComment)
.map(PinComment::getId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mapbefine.mapbefine.member.domain.MemberInfo;
import com.mapbefine.mapbefine.pin.domain.PinComment;
import java.time.LocalDateTime;
import java.util.Optional;

public record PinCommentResponse(
Long id,
Expand All @@ -14,32 +15,19 @@ public record PinCommentResponse(
LocalDateTime updatedAt
) {

public static PinCommentResponse ofParentComment(PinComment pinComment, boolean canChange) {
MemberInfo memberInfo = pinComment.getCreator().getMemberInfo();

return new PinCommentResponse(
pinComment.getId(),
pinComment.getContent(),
memberInfo.getNickName(),
memberInfo.getImageUrl(),
null,
canChange,
pinComment.getUpdatedAt()
);
}

public static PinCommentResponse ofChildComment(PinComment pinComment, boolean canChange) {
public static PinCommentResponse of(PinComment pinComment, boolean canChange) {
MemberInfo memberInfo = pinComment.getCreator().getMemberInfo();
Optional<Long> parentPinCommentId = pinComment.getParentPinCommentId();

return new PinCommentResponse(
pinComment.getId(),
pinComment.getContent(),
memberInfo.getNickName(),
memberInfo.getImageUrl(),
pinComment.getParentPinComment().getId(),
canChange,
pinComment.getUpdatedAt()
);
pinComment.getId(),
pinComment.getContent(),
memberInfo.getNickName(),
memberInfo.getImageUrl(),
parentPinCommentId.orElse(null),
canChange,
pinComment.getUpdatedAt()
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ public enum PinCommentErrorCode {

ILLEGAL_CONTENT_NULL("11000", "핀 댓글의 내용은 필수로 입력해야합니다."),
ILLEGAL_CONTENT_LENGTH("11001", "핀 댓글의 내용이 최소 1 자에서 최대 1000 자여야 합니다."),
FORBIDDEN_PIN_COMMENT_CREATE("11002", "핀 댓글을 추가할 권한이 없습니다."),
FORBIDDEN_PIN_COMMENT_UPDATE("11003", "핀 댓글을 수정할 권한이 없습니다."),
FORBIDDEN_PIN_COMMENT_DELETE("11004", "핀 댓글을 삭제할 권한이 없습니다."),
PIN_COMMENT_NOT_FOUND("11005", "존재하지 않는 핀 댓글입니다."),
ILLEGAL_PIN_COMMENT_DEPTH("11002", "핀 대댓글에는 대댓글을 달 수 없습니다."),
FORBIDDEN_PIN_COMMENT_CREATE("11003", "핀 댓글을 추가할 권한이 없습니다."),
FORBIDDEN_PIN_COMMENT_UPDATE("11004", "핀 댓글을 수정할 권한이 없습니다."),
FORBIDDEN_PIN_COMMENT_DELETE("11005", "핀 댓글을 삭제할 권한이 없습니다."),
PIN_COMMENT_NOT_FOUND("11006", "존재하지 않는 핀 댓글입니다."),
;

private final String code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public ResponseEntity<Void> addPinComment(AuthMember member, @RequestBody PinCom
.build();
}

@GetMapping("/comments/{pinId}")
@GetMapping("/{pinId}/comments")
public ResponseEntity<List<PinCommentResponse>> findPinCommentByPinId(AuthMember member, @PathVariable Long pinId) {
List<PinCommentResponse> allResponse = pinQueryService.findAllPinCommentByPinId(member, pinId);
List<PinCommentResponse> allResponse = pinQueryService.findAllPinCommentsByPinId(member, pinId);

return ResponseEntity.ok(allResponse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ public static PinComment createParentComment(
Pin pin,
Member creator
) {
return PinComment.of(
return PinComment.ofParentPinComment(
pin,
null,
creator,
"댓글"
);
Expand All @@ -23,7 +22,7 @@ public static PinComment createChildComment(
Member creator,
PinComment savedParentPinComment
) {
return PinComment.of(
return PinComment.ofChildPinComment(
pin,
savedParentPinComment,
creator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.io.File;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -299,7 +298,6 @@
void findPinCommentPinId_Success() {
//given
long pinId = createPinAndGetId(createRequestDuplicateLocation);

Pin pin = pinRepository.findById(pinId).get();
PinComment parentPinComment = pinCommentRepository.save(
PinCommentFixture.createParentComment(pin, member)
Expand All @@ -308,8 +306,8 @@
PinCommentFixture.createChildComment(pin, member, parentPinComment)
);
List<PinCommentResponse> expected = List.of(
PinCommentResponse.ofParentComment(parentPinComment, true),
PinCommentResponse.ofChildComment(childPinComment, true)
PinCommentResponse.of(parentPinComment, true),
PinCommentResponse.of(childPinComment, true)
);

// when
Expand All @@ -321,12 +319,11 @@
.then().log().all()
.extract();

List<PinCommentResponse> pinResponses = response.as(new TypeRef<>() {});

// then
List<PinCommentResponse> pinCommentResponses = response.as(new TypeRef<>() {});

Check failure on line 323 in backend/src/test/java/com/mapbefine/mapbefine/pin/PinIntegrationTest.java

View workflow job for this annotation

GitHub Actions / JUnit Test Report

PinIntegrationTest.핀 댓글을 조회하면 200을 반환한다.

java.lang.IllegalStateException: Cannot parse content to java.util.List<com.mapbefine.mapbefine.pin.dto.response.PinCommentResponse> because no content-type was present in the response and no default parser has been set. You can specify a default parser using e.g.: RestAssured.defaultParser = Parser.JSON; or you can specify an explicit ObjectMapper using as(java.util.List<com.mapbefine.mapbefine.pin.dto.response.PinCommentResponse>, <ObjectMapper>);
Raw output
java.lang.IllegalStateException: Cannot parse content to java.util.List<com.mapbefine.mapbefine.pin.dto.response.PinCommentResponse> because no content-type was present in the response and no default parser has been set.
You can specify a default parser using e.g.:
RestAssured.defaultParser = Parser.JSON;

or you can specify an explicit ObjectMapper using as(java.util.List<com.mapbefine.mapbefine.pin.dto.response.PinCommentResponse>, <ObjectMapper>);
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)
	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:60)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:86)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$_as_closure3.doCall(RestAssuredResponseOptionsGroovyImpl.groovy:226)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$_as_closure3.doCall(RestAssuredResponseOptionsGroovyImpl.groovy)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1006)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.findContentType(RestAssuredResponseOptionsGroovyImpl.groovy:494)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.this$2$findContentType(RestAssuredResponseOptionsGroovyImpl.groovy)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:198)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:62)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.as(RestAssuredResponseOptionsGroovyImpl.groovy:225)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$as$3.callCurrent(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$as$3.callCurrent(Unknown Source)
	at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.as(RestAssuredResponseOptionsGroovyImpl.groovy:246)
	at io.restassured.internal.RestAssuredResponseOptionsImpl.as(RestAssuredResponseOptionsImpl.java:186)
	at com.mapbefine.mapbefine.pin.PinIntegrationTest.findPinCommentPinId_Success(PinIntegrationTest.java:323)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy1/jdk.proxy1.$Proxy2.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
assertThat(response.statusCode()).isEqualTo(HttpStatus.OK.value());
assertThat(pinResponses).hasSize(2);
assertThat(pinResponses).usingRecursiveComparison()
assertThat(pinCommentResponses).hasSize(2);
assertThat(pinCommentResponses).usingRecursiveComparison()
.ignoringFieldsOfTypes(LocalDateTime.class)
.isEqualTo(expected);
}
Expand Down
Loading
Loading