From 6ccaa9d7b2a8692b1980a55691d1a803ad42e244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A7=84=EC=A3=BC=EC=9B=90?= <84346055+jinjoo-lab@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:40:24 +0900 Subject: [PATCH] [FEAT] Path Service Test --- .../domain/path/service/PathServiceTest.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 backend/src/test/java/com/twtw/backend/domain/path/service/PathServiceTest.java diff --git a/backend/src/test/java/com/twtw/backend/domain/path/service/PathServiceTest.java b/backend/src/test/java/com/twtw/backend/domain/path/service/PathServiceTest.java new file mode 100644 index 00000000..2081f9eb --- /dev/null +++ b/backend/src/test/java/com/twtw/backend/domain/path/service/PathServiceTest.java @@ -0,0 +1,57 @@ +package com.twtw.backend.domain.path.service; + +import com.twtw.backend.domain.path.dto.client.car.SearchCarPathRequest; +import com.twtw.backend.domain.path.dto.client.car.SearchCarPathResponse; +import com.twtw.backend.domain.path.dto.client.car.SearchPathFuel; +import com.twtw.backend.domain.path.dto.client.car.SearchPathOption; +import com.twtw.backend.domain.path.dto.client.ped.SearchPedPathRequest; +import com.twtw.backend.domain.path.dto.client.ped.SearchPedPathResponse; +import com.twtw.backend.support.service.LoginTest; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import static org.assertj.core.api.Assertions.assertThat; + + +@DisplayName("PathService의") +public class PathServiceTest extends LoginTest { + @Autowired private PathService pathService; + + @Test + @DisplayName("차량 경로를 탐색할 수 있는가") + void searchCarPath(){ + // given + SearchCarPathRequest request = new SearchCarPathRequest( + "126.827507,37.636040", + "126.832659,37.644998", + "", + SearchPathOption.TRAFAST, + SearchPathFuel.DIESEL, + 1); + // when + + SearchCarPathResponse response = pathService.searchCarPath(request); + + // then + + assertThat(response.getCode()).isEqualTo(0); + } + + @Test + @DisplayName("보행자 경로를 탐색할 수 있는가") + void searchPedPath(){ + // given + SearchPedPathRequest request = new SearchPedPathRequest( + 126.827507,37.636040, + 126.832659,37.644998, + "START_POINT", + "END_POINT" + ); + // when + SearchPedPathResponse response = pathService.searchPedPath(request); + + // then + assertThat(response).isNotNull(); + } +}