-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from HongDam-org/feat/path-test
[FEAT] Path Service Test
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
backend/src/test/java/com/twtw/backend/domain/path/service/PathServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |