File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
services-directions-models/src/test/java/com/mapbox/api/directions/v5/models Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,10 @@ public void fromJson_correctlyBuildsFromJson() throws Exception {
87
87
88
88
@ Test
89
89
public void deserialization_from_byte_buffer () throws Exception {
90
- String json = loadJsonFixture (DIRECTIONS_V5_PRECISION6_FIXTURE );
91
- ByteBuffer buffer = ByteBuffer .wrap (json .getBytes (StandardCharsets .UTF_8 ));
90
+ byte [] json = loadJsonFixture (DIRECTIONS_V5_PRECISION6_FIXTURE ).getBytes (StandardCharsets .UTF_8 );
91
+ ByteBuffer buffer = ByteBuffer .allocateDirect (json .length );
92
+ buffer .put (json );
93
+ buffer .position (0 );
92
94
DirectionsResponse response = DirectionsResponse .fromJson (buffer , StandardCharsets .UTF_8 );
93
95
assertNotNull (response );
94
96
assertEquals (1 , response .routes ().size ());
You can’t perform that action at this time.
0 commit comments