@Test
public void deleteOfflineMapShouldCreateValidIntentAndCallStartService() {

    String mapName = "kampala-map";
    String mapboxAccessToken = "access-token-here";
    ArrayList<Object> results = new ArrayList<>();
    Mockito.doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            Intent intent = invocation.getArgument(0);
            results.add(intent.getStringExtra(Constants.PARCELABLE_KEY_MAP_UNIQUE_NAME));
            results.add(intent.getStringExtra(Constants.PARCELABLE_KEY_MAPBOX_ACCESS_TOKEN));
            results.add((MapboxOfflineDownloaderService.SERVICE_ACTION) intent.getExtras().get(Constants.PARCELABLE_KEY_SERVICE_ACTION));
            return null;
        }
    })
            .when(context)
            .startService(Mockito.any(Intent.class));
    OfflineServiceHelper.deleteOfflineMap(context, mapName, mapboxAccessToken);
    Mockito.verify(context, Mockito.times(1))
            .startService(Mockito.any(Intent.class));
    assertEquals(mapName, results.get(0));
    assertEquals(mapboxAccessToken, results.get(1));
    assertEquals(MapboxOfflineDownloaderService.SERVICE_ACTION.DELETE_MAP, results.get(2));
}