@@ -52,4 +52,42 @@ void testRangeTypeGetValue() {
5252 assertEquals ("time" , BenchmarkEnums .RangeType .TIME .getValue ());
5353 assertEquals ("distance" , BenchmarkEnums .RangeType .DISTANCE .getValue ());
5454 }
55+
56+ @ Test
57+ void testMatrixModesFromString () {
58+ assertEquals (BenchmarkEnums .MatrixModes .ALGO_DIJKSTRA_MATRIX , BenchmarkEnums .MatrixModes .fromString ("algodijkstra" ));
59+ assertEquals (BenchmarkEnums .MatrixModes .ALGO_CORE_MATRIX , BenchmarkEnums .MatrixModes .fromString ("algocore" ));
60+ assertEquals (BenchmarkEnums .MatrixModes .ALGO_RPHAST_MATRIX , BenchmarkEnums .MatrixModes .fromString ("algorphast" ));
61+
62+ Throwable exception = assertThrows (IllegalArgumentException .class , () -> BenchmarkEnums .MatrixModes .fromString ("invalid" ));
63+ assertTrue (exception instanceof IllegalArgumentException );
64+ }
65+
66+ @ Test
67+ void testMatrixModesGetDefaultProfiles () {
68+ List <String > dijkstraProfiles = BenchmarkEnums .MatrixModes .ALGO_DIJKSTRA_MATRIX .getProfiles ();
69+ assertTrue (dijkstraProfiles .contains ("driving-car" ));
70+ assertTrue (dijkstraProfiles .contains ("foot-walking" ));
71+ assertEquals (4 , dijkstraProfiles .size ());
72+
73+ List <String > coreProfiles = BenchmarkEnums .MatrixModes .ALGO_CORE_MATRIX .getProfiles ();
74+ assertTrue (coreProfiles .contains ("driving-car" ));
75+ assertTrue (coreProfiles .contains ("foot-walking" ));
76+ assertEquals (4 , coreProfiles .size ());
77+ }
78+
79+ @ Test
80+ void testMatrixModesGetRequestParams () {
81+ Map <String , Object > rphastParams = BenchmarkEnums .MatrixModes .ALGO_RPHAST_MATRIX .getRequestParams ();
82+ assertEquals ("recommended" , rphastParams .get ("preference" ));
83+ assertEquals (1 , rphastParams .size ());
84+
85+ Map <String , Object > coreParams = BenchmarkEnums .MatrixModes .ALGO_CORE_MATRIX .getRequestParams ();
86+ assertEquals ("recommended" , coreParams .get ("preference" ));
87+ assertTrue (coreParams .get ("options" ) instanceof Map );
88+
89+ Map <String , Object > dijkstraParams = BenchmarkEnums .MatrixModes .ALGO_DIJKSTRA_MATRIX .getRequestParams ();
90+ assertEquals ("recommended" , dijkstraParams .get ("preference" ));
91+ assertTrue (dijkstraParams .get ("options" ) instanceof List );
92+ }
5593}
0 commit comments