Skip to content

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Devota Aabel committed Feb 12, 2019
1 parent a6e16fc commit 2e1fbba
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mapbox.api.directionsrefresh.v5;

import com.mapbox.api.directionsrefresh.v5.models.DirectionsRefreshResponse;
import com.mapbox.core.TestUtils;

import org.hamcrest.junit.ExpectedException;
Expand All @@ -15,6 +16,9 @@
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import retrofit2.Response;

import static org.junit.Assert.assertEquals;

public class MapboxDirectionsRefreshTest extends TestUtils {

Expand Down Expand Up @@ -63,4 +67,17 @@ public void sanity() throws Exception {

Assert.assertNotNull(mapboxDirectionsRefresh);
}

@Test
public void testResponse() throws IOException {
MapboxDirectionsRefresh mapboxDirectionsRefresh = MapboxDirectionsRefresh.builder()
.accessToken(ACCESS_TOKEN)
.requestId("")
.baseUrl(mockUrl.toString())
.build();

Response<DirectionsRefreshResponse> response = mapboxDirectionsRefresh.executeCall();
assertEquals(200, response.code());
assertEquals("Ok", response.body().code());
}
}

0 comments on commit 2e1fbba

Please sign in to comment.