use of org.infobip.mobile.messaging.api.support.http.client.model.ApiError in project mobile-messaging-sdk-android by infobip.
the class DefaultApiClientTest method execute_withQueryParams_withHeaders_noBody_receivesError.
@Test(expected = ApiException.class)
public void execute_withQueryParams_withHeaders_noBody_receivesError() throws Exception {
debugServer.respondWith(NanoHTTPD.Response.Status.UNAUTHORIZED, DefaultApiClient.JSON_SERIALIZER.serialize(new ApiResponse(new ApiError(new ApiServiceException("1", "Invalid Application ID")))));
apiClient.execute(HttpMethod.GET, "http://127.0.0.1:" + debugServer.getListeningPort(), null, null, MapUtils.map("applicationId", "xyz", "currentRegistrationId", "1234"), MapUtils.map("X-Test-1", "test1", "X-Test-2", "test2"), null, ApiResponse.class);
}
use of org.infobip.mobile.messaging.api.support.http.client.model.ApiError in project mobile-messaging-sdk-android by infobip.
the class DefaultApiClientTest method execute_withQueryParams_noHeaders_withBody_receivesError.
@Test(expected = ApiException.class)
public void execute_withQueryParams_noHeaders_withBody_receivesError() throws Exception {
debugServer.respondWith(NanoHTTPD.Response.Status.UNAUTHORIZED, DefaultApiClient.JSON_SERIALIZER.serialize(new ApiResponse(new ApiError(new ApiServiceException("1", "Invalid Application ID")))));
apiClient.execute(HttpMethod.POST, "http://127.0.0.1:" + debugServer.getListeningPort(), null, null, MapUtils.map("applicationId", "xyz", "currentRegistrationId", "1234"), null, new SomeApiRequest("Test"), ApiResponse.class);
}
use of org.infobip.mobile.messaging.api.support.http.client.model.ApiError in project mobile-messaging-sdk-android by infobip.
the class DefaultApiClientTest method execute_withQueryParams_noHeaders_noBody_receivesError.
@Test(expected = ApiException.class)
public void execute_withQueryParams_noHeaders_noBody_receivesError() throws Exception {
debugServer.respondWith(NanoHTTPD.Response.Status.UNAUTHORIZED, DefaultApiClient.JSON_SERIALIZER.serialize(new ApiResponse(new ApiError(new ApiServiceException("1", "Invalid Application ID")))));
apiClient.execute(HttpMethod.GET, "http://127.0.0.1:" + debugServer.getListeningPort(), null, null, MapUtils.map("applicationId", "xyz", "currentRegistrationId", "1234"), null, null, ApiResponse.class);
}
use of org.infobip.mobile.messaging.api.support.http.client.model.ApiError in project mobile-messaging-sdk-android by infobip.
the class DefaultApiClientTest method execute_withQueryParams_withHeaders_withBody_receivesError.
@Test(expected = ApiException.class)
public void execute_withQueryParams_withHeaders_withBody_receivesError() throws Exception {
debugServer.respondWith(NanoHTTPD.Response.Status.UNAUTHORIZED, DefaultApiClient.JSON_SERIALIZER.serialize(new ApiResponse(new ApiError(new ApiServiceException("1", "Invalid Application ID")))));
apiClient.execute(HttpMethod.POST, "http://127.0.0.1:" + debugServer.getListeningPort(), null, null, MapUtils.map("applicationId", "xyz", "currentRegistrationId", "1234"), MapUtils.map("X-Test-1", "test1", "X-Test-2", "test2"), new SomeApiRequest("Test"), ApiResponse.class);
}
Aggregations