urbanairship-core/src/test/java/com/urbanairship/remotedata/RemoteDataApiClientTest.java
@Test
    public void testFetchRemoteDataRequestFailure() throws Exception {
        Map<String, List<String>> headers = new HashMap<>();

        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_NOT_IMPLEMENTED)
                .setResponseHeaders(headers)
                .setResponseMessage("Not Implemented")
                .create();

        String requestTimestamp = DateUtils.createIso8601TimeStamp(0);
        Response response = client.fetchRemoteData(requestTimestamp);

        assertNotNull("Response should not be null", response);
        assertEquals("Response status should be 501", HttpURLConnection.HTTP_NOT_IMPLEMENTED, response.getStatus());
    }
/**
     * Test fetch remote data request on failure
     */
Test fetch remote data request on failure
Test fetch remote data request on failure
@Test
    public void testFetchRemoteDataRequestFailure() throws Exception {
        Map<String, List<String>> headers = new HashMap<>();
        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_NOT_IMPLEMENTED)
                .setResponseHeaders(headers)
                .setResponseMessage("Not Implemented")
                .create();
        String requestTimestamp = DateUtils.createIso8601TimeStamp(0);
        Response response = client.fetchRemoteData(requestTimestamp);
        assertNotNull("Response should not be null", response);
        assertEquals("Response status should be 501", HttpURLConnection.HTTP_NOT_IMPLEMENTED, response.getStatus());
    }
@ Test public void testFetchRemoteDataRequestFailure ( ) throws Exception { Map < String , List < String > > headers = new HashMap < > ( ) ; testRequest . response = new Response . Builder ( HttpURLConnection . HTTP_NOT_IMPLEMENTED ) . setResponseHeaders ( headers ) . setResponseMessage ( "Not Implemented" ) . create ( ) ; String requestTimestamp = DateUtils . createIso8601TimeStamp ( 0 ) ; Response response = client . fetchRemoteData ( requestTimestamp ) ; assertNotNull ( "Response should not be null" , response ) ; assertEquals ( "Response status should be 501" , HttpURLConnection . HTTP_NOT_IMPLEMENTED , response . getStatus ( ) ) ; }
Test fetch remote data request on failure
Test fetch remote data request on failure