@@ -37,16 +37,18 @@ public class RouteServiceIntegrationTest extends BaseMvcTest {
37
37
@ Order (1 )
38
38
@ DisplayName ("기본 길찾기 테스트: 노드 - 노드" )
39
39
void nodeRouteTest () {
40
- List <Node > nodeList = nodeRepository .findAll ();
41
- for (Node start : nodeList ) {
42
- for (Node end : nodeList ) {
40
+ List <Node > nodeList = nodeRepository .findRandomNodes (); // 무작위 노드 20개
41
+ for (int i = 0 ; i < nodeList .size () - 1 ; i ++) {
42
+ Node start = nodeList .get (i );
43
+ for (int j = i +1 ; j < nodeList .size (); j ++) {
44
+ Node end = nodeList .get (j );
43
45
try {
44
- System .out .println ("start_node_id: " + start .getId () + " end_node_id: " + end .getId ());
46
+ System .out .println ("-------------------------" + " start_node_id: " + start .getId () + " end_node_id: " + end .getId ());
45
47
routeService .findRoute (LocationType .NODE , start .getId (), null , null , LocationType .NODE , end .getId (), null , null , null );
46
48
} catch (AdminException e ) {
47
- System .out .println (e .getAdminMessage ());
49
+ System .out .println ("##########################" + e .getAdminMessage ());
48
50
} catch (GlobalException e ) {
49
- System .out .println (e .getResultCode ());
51
+ System .out .println ("##########################" + e .getResultCode ());
50
52
}
51
53
}
52
54
}
@@ -57,17 +59,17 @@ void nodeRouteTest() {
57
59
@ DisplayName ("기본 길찾기 테스트: 빌딩 - 빌딩" )
58
60
void buildingRouteTest () {
59
61
List <Building > buildingList = buildingRepository .findAll ();
60
- for (Building start : buildingList ) {
61
- for ( Building end : buildingList ) {
62
- if ( start . getId () != 0 && end . getId () != 0 && ! start . getId (). equals ( end . getId ()) ) {
63
- try {
64
- System . out . println ( "start_building_id: " + start . getId () + " end_building_id: " + end . getId ());
65
- routeService . findRoute ( LocationType . BUILDING , start .getId (), null , null , LocationType . BUILDING , end .getId (), null , null , null );
66
- } catch ( AdminException e ) {
67
- System . out . println ( e . getAdminMessage ());
68
- } catch ( GlobalException e ) {
69
- System . out . println ( e . getResultCode ());
70
- }
62
+ for (int i = 1 ; i < buildingList . size () - 1 ; i ++ ) {
63
+ Building start = buildingList . get ( i );
64
+ for ( int j = i + 1 ; j < buildingList . size (); j ++ ) {
65
+ Building end = buildingList . get ( j );
66
+ try {
67
+ System . out . println ( "-------------------------" + "start_building_id: " + start .getId () + " end_building_id: " + end .getId ());
68
+ routeService . findRoute ( LocationType . BUILDING , start . getId (), null , null , LocationType . BUILDING , end . getId (), null , null , null );
69
+ } catch ( AdminException e ) {
70
+ System . out . println ( "##########################" + e . getAdminMessage ());
71
+ } catch ( GlobalException e ) {
72
+ System . out . println ( "##########################" + e . getResultCode ());
71
73
}
72
74
}
73
75
}
0 commit comments