Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 15, 2023
1 parent 17c930b commit 1e67206
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.twtw.backend.domain.place.entity.Place;
import com.twtw.backend.domain.plan.dto.client.PlaceDetails;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.twtw.backend.global.audit.AuditListener;
import com.twtw.backend.global.audit.Auditable;
import com.twtw.backend.global.audit.BaseTime;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
Expand All @@ -19,15 +20,18 @@
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import org.hibernate.annotations.Where;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

@Getter
@Entity
@Where(clause = "deleted_at is null")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import com.twtw.backend.fixture.place.PlaceDetailsFixture;
import com.twtw.backend.fixture.plan.PlanEntityFixture;
import com.twtw.backend.support.service.LoginTest;
import java.util.Optional;
import java.util.UUID;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Optional;
import java.util.UUID;

@DisplayName("PlanService의")
class PlanServiceTest extends LoginTest {

Expand All @@ -35,7 +37,8 @@ class PlanServiceTest extends LoginTest {
@DisplayName("목적지 검색이 수행되는가")
void searchPlanDestination() {
// given
final SearchDestinationRequest given = new SearchDestinationRequest("스타벅스", 123.321, 123.123, 1, CategoryGroupCode.CE7);
final SearchDestinationRequest given =
new SearchDestinationRequest("스타벅스", 123.321, 123.123, 1, CategoryGroupCode.CE7);

// when
final PlanDestinationResponse result = planService.searchPlanDestination(given);
Expand All @@ -52,7 +55,10 @@ void savePlan() {
final UUID groupId = groupRepository.save(GroupEntityFixture.HDJ_GROUP.toEntity()).getId();

// when
final PlanResponse planResponse = planService.savePlan(new SavePlanRequest(groupId, PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));
final PlanResponse planResponse =
planService.savePlan(
new SavePlanRequest(
groupId, PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));

// then
final Optional<Plan> result = planRepository.findById(planResponse.getPlanId());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
package com.twtw.backend.fixture.place;

import com.twtw.backend.domain.place.entity.CategoryGroupCode;

import com.twtw.backend.domain.plan.dto.client.PlaceDetails;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public enum PlaceDetailsFixture {
FIRST_PLACE("스타벅스", 30, "http://someUrlToPlaceDetails", "카페", "주소", "도로명주소", CategoryGroupCode.CE7, 123.123, 321.321),
SECOND_PLACE("별다방", 20, "http://someUrlToPlaceInMap", "숙박", "밥좀주소", "도로명좀주소", CategoryGroupCode.AD5, 345.543, 543.345);
FIRST_PLACE(
"스타벅스",
30,
"http://someUrlToPlaceDetails",
"카페",
"주소",
"도로명주소",
CategoryGroupCode.CE7,
123.123,
321.321),
SECOND_PLACE(
"별다방",
20,
"http://someUrlToPlaceInMap",
"숙박",
"밥좀주소",
"도로명좀주소",
CategoryGroupCode.AD5,
345.543,
543.345);

private final String placeName;
private final Integer distance;
Expand All @@ -21,6 +39,15 @@ public enum PlaceDetailsFixture {
private final Double y;

public PlaceDetails toPlaceDetails() {
return new PlaceDetails(placeName, distance, placeUrl, categoryName, addressName, roadAddressName, categoryGroupCode, x, y);
return new PlaceDetails(
placeName,
distance,
placeUrl,
categoryName,
addressName,
roadAddressName,
categoryGroupCode,
x,
y);
}
}

0 comments on commit 1e67206

Please sign in to comment.