Skip to content

Commit

Permalink
Merge pull request #71 from HongDam-org/feat/path-test
Browse files Browse the repository at this point in the history
[FEAT] Path Service Test
  • Loading branch information
jinjoo-lab authored Nov 27, 2023
2 parents 7d0f94a + 27e5990 commit 262f311
Showing 1 changed file with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.twtw.backend.domain.path.service;

import static org.assertj.core.api.Assertions.assertThat;

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;

@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();
}
}

0 comments on commit 262f311

Please sign in to comment.