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 20, 2023
1 parent e87aa8e commit 89b413f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,35 @@
import com.twtw.backend.fixture.place.PlaceEntityFixture;
import com.twtw.backend.global.client.KakaoMapClient;
import com.twtw.backend.support.service.LoginTest;
import java.util.List;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;

import java.util.List;

@DisplayName("PlaceService의")
class PlaceServiceTest extends LoginTest {

@Autowired private PlaceService placeService;
@MockBean private KakaoMapClient<SurroundPlaceRequest, SurroundPlaceResponse> surroundPlaceClient;

@MockBean
private KakaoMapClient<SurroundPlaceRequest, SurroundPlaceResponse> surroundPlaceClient;

@Test
@DisplayName("주변 장소 찾기가 수행되는가")
void searchSurroundPlace() {
// given
final SurroundPlaceResponse expected = new SurroundPlaceResponse(
new MetaDetails(true),
List.of(PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));
final SurroundPlaceResponse expected =
new SurroundPlaceResponse(
new MetaDetails(true),
List.of(PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));
given(surroundPlaceClient.request(any())).willReturn(expected);

// when
final PlaceResponse result = placeService.searchSurroundPlace(new SurroundPlaceRequest(1.1, 2.2, 1));
final PlaceResponse result =
placeService.searchSurroundPlace(new SurroundPlaceRequest(1.1, 2.2, 1));

// then
assertThat(result.getResults()).hasSameElementsAs(expected.getDocuments());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import com.twtw.backend.fixture.place.PlaceEntityFixture;
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 Down Expand Up @@ -98,7 +100,14 @@ void outPlan() {
@DisplayName("PK로 계획 조회가 수행되는가") // TODO Fixture 사용하여 저장시 에러 확인
void getPlanById() {
// given
final UUID planId = planRepository.save(new Plan(loginUser, PlaceEntityFixture.SECOND_PLACE.toEntity(), GroupEntityFixture.HDJ_GROUP.toEntity())).getId();
final UUID planId =
planRepository
.save(
new Plan(
loginUser,
PlaceEntityFixture.SECOND_PLACE.toEntity(),
GroupEntityFixture.HDJ_GROUP.toEntity()))
.getId();

// when
final PlanInfoResponse result = planService.getPlanById(planId);
Expand All @@ -111,7 +120,14 @@ void getPlanById() {
@DisplayName("삭제가 수행되는가") // TODO Fixture 사용하여 저장시 에러 확인
void deletePlan() {
// given
final UUID planId = planRepository.save(new Plan(loginUser, PlaceEntityFixture.SECOND_PLACE.toEntity(), GroupEntityFixture.HDJ_GROUP.toEntity())).getId();
final UUID planId =
planRepository
.save(
new Plan(
loginUser,
PlaceEntityFixture.SECOND_PLACE.toEntity(),
GroupEntityFixture.HDJ_GROUP.toEntity()))
.getId();

// when
planService.deletePlan(planId);
Expand Down

0 comments on commit 89b413f

Please sign in to comment.