urbanairship-core/src/test/java/com/urbanairship/iam/tags/TagGroupLookupApiClientTest.java
@Test
    public void testCachedResponse() throws JsonException {
        // Get a valid response
        TagGroupResponse response = client.lookupTagGroups("some-channel", UAirship.ANDROID_PLATFORM, requestTags, null);
        verifyRequest(UAirship.ANDROID_PLATFORM, "some-channel", requestTags, null);

        // Update the response to return a 200 with the same lastModified time as the
        // response, but no tags. This indicates a 304, but since its a POST we do not
        // get a 304.
        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_OK)
                .setResponseMessage("OK")
                .setResponseBody(JsonMap.newBuilder()
                                        .put("last_modified", "lastModifiedTime")
                                        .build().toString())
                .create();

        TagGroupResponse cachedResponse = client.lookupTagGroups("some-channel", UAirship.ANDROID_PLATFORM, requestTags, response);
        verifyRequest(UAirship.ANDROID_PLATFORM, "some-channel", requestTags, response.lastModifiedTime);

        // Should return the original response
        assertEquals(cachedResponse, response);
    }
/**
     * Test when requesting tags with a cachedResponse, if the new response last_modified_time
     * matches, the cachedResponse is returned.
     */
Test when requesting tags with a cachedResponse, if the new response last_modified_time
matches, the cachedResponse is returned.
Test when requesting tags with a cachedResponse if the new response last_modified_time matches the cachedResponse is returned .
@Test
    public void testCachedResponse() throws JsonException {
        TagGroupResponse response = client.lookupTagGroups("some-channel", UAirship.ANDROID_PLATFORM, requestTags, null);
        verifyRequest(UAirship.ANDROID_PLATFORM, "some-channel", requestTags, null);
        testRequest.response = new Response.Builder(HttpURLConnection.HTTP_OK)
                .setResponseMessage("OK")
                .setResponseBody(JsonMap.newBuilder()
                                        .put("last_modified", "lastModifiedTime")
                                        .build().toString())
                .create();
        TagGroupResponse cachedResponse = client.lookupTagGroups("some-channel", UAirship.ANDROID_PLATFORM, requestTags, response);
        verifyRequest(UAirship.ANDROID_PLATFORM, "some-channel", requestTags, response.lastModifiedTime);
        assertEquals(cachedResponse, response);
    }
@ Test public void testCachedResponse ( ) throws JsonException { TagGroupResponse response = client . lookupTagGroups ( "some-channel" , UAirship . ANDROID_PLATFORM , requestTags , null ) ; verifyRequest ( UAirship . ANDROID_PLATFORM , "some-channel" , requestTags , null ) ; testRequest . response = new Response . Builder ( HttpURLConnection . HTTP_OK ) . setResponseMessage ( "OK" ) . setResponseBody ( JsonMap . newBuilder ( ) . put ( "last_modified" , "lastModifiedTime" ) . build ( ) . toString ( ) ) . create ( ) ; TagGroupResponse cachedResponse = client . lookupTagGroups ( "some-channel" , UAirship . ANDROID_PLATFORM , requestTags , response ) ; verifyRequest ( UAirship . ANDROID_PLATFORM , "some-channel" , requestTags , response . lastModifiedTime ) ; assertEquals ( cachedResponse , response ) ; }
Test when requesting tags with a cachedResponse, if the new response last_modified_time
 matches, the cachedResponse is returned.
Test when requesting tags with a cachedResponse if the new response last_modified_time matches the cachedResponse is returned .
// Get a valid response // Update the response to return a 200 with the same lastModified time as the // response, but no tags. This indicates a 304, but since its a POST we do not // get a 304. // Should return the original response