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

        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_OK)
                .setResponseHeaders(headers)
                .setResponseMessage("OK")
                .create();

        URL channelLocation = new URL("https://go.urbanairship.com/api/channels/someChannelId");
        Response response = client.updateChannelWithPayload(channelLocation, payload);

        assertNotNull("Channel response should not be null", response);
        assertEquals("Channel request should be the JSON payload", testRequest.getRequestBody(), payload.toJsonValue().toString());
        assertEquals("Channel response status should be 200", HttpURLConnection.HTTP_OK,
                response.getStatus());
    }
/**
     * Test update channel succeeds request if the status is 200
     */
Test update channel succeeds request if the status is 200
Test update channel succeeds request if the status is 200
@Test
    public void testUpdateChannelSucceedsRequest() throws Exception {
        Map<String, List<String>> headers = new HashMap<>();
        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_OK)
                .setResponseHeaders(headers)
                .setResponseMessage("OK")
                .create();
        URL channelLocation = new URL("https://go.urbanairship.com/api/channels/someChannelId");
        Response response = client.updateChannelWithPayload(channelLocation, payload);
        assertNotNull("Channel response should not be null", response);
        assertEquals("Channel request should be the JSON payload", testRequest.getRequestBody(), payload.toJsonValue().toString());
        assertEquals("Channel response status should be 200", HttpURLConnection.HTTP_OK,
                response.getStatus());
    }
@ Test public void testUpdateChannelSucceedsRequest ( ) throws Exception { Map < String , List < String > > headers = new HashMap < > ( ) ; testRequest . response = new Response . Builder ( HttpURLConnection . HTTP_OK ) . setResponseHeaders ( headers ) . setResponseMessage ( "OK" ) . create ( ) ; URL channelLocation = new URL ( "https://go.urbanairship.com/api/channels/someChannelId" ) ; Response response = client . updateChannelWithPayload ( channelLocation , payload ) ; assertNotNull ( "Channel response should not be null" , response ) ; assertEquals ( "Channel request should be the JSON payload" , testRequest . getRequestBody ( ) , payload . toJsonValue ( ) . toString ( ) ) ; assertEquals ( "Channel response status should be 200" , HttpURLConnection . HTTP_OK , response . getStatus ( ) ) ; }
Test update channel succeeds request if the status is 200
Test update channel succeeds request if the status is 200