urbanairship-core/src/test/java/com/urbanairship/push/NamedUserJobHandlerTest.java
@Test
    public void testUpdateNamedUserTagsRetry() {
        // Return a named user ID
        when(namedUser.getId()).thenReturn("namedUserId");

        // Provide pending changes
        when(tagGroupRegistrar.uploadMutations(TagGroupRegistrar.NAMED_USER, "namedUserId")).thenReturn(false);

        // Perform the update
        JobInfo jobInfo = JobInfo.newBuilder().setAction(NamedUserJobHandler.ACTION_UPDATE_TAG_GROUPS).build();
        Assert.assertEquals(JobInfo.JOB_RETRY, jobHandler.performJob(jobInfo));
    }
/**
     * Test update named user retries when the upload fails.
     */
Test update named user retries when the upload fails.
Test update named user retries when the upload fails .
@Test
    public void testUpdateNamedUserTagsRetry() {
        when(namedUser.getId()).thenReturn("namedUserId");
        when(tagGroupRegistrar.uploadMutations(TagGroupRegistrar.NAMED_USER, "namedUserId")).thenReturn(false);
        JobInfo jobInfo = JobInfo.newBuilder().setAction(NamedUserJobHandler.ACTION_UPDATE_TAG_GROUPS).build();
        Assert.assertEquals(JobInfo.JOB_RETRY, jobHandler.performJob(jobInfo));
    }
@ Test public void testUpdateNamedUserTagsRetry ( ) { when ( namedUser . getId ( ) ) . thenReturn ( "namedUserId" ) ; when ( tagGroupRegistrar . uploadMutations ( TagGroupRegistrar . NAMED_USER , "namedUserId" ) ) . thenReturn ( false ) ; JobInfo jobInfo = JobInfo . newBuilder ( ) . setAction ( NamedUserJobHandler . ACTION_UPDATE_TAG_GROUPS ) . build ( ) ; Assert . assertEquals ( JobInfo . JOB_RETRY , jobHandler . performJob ( jobInfo ) ) ; }
Test update named user retries when the upload fails.
Test update named user retries when the upload fails .
// Return a named user ID // Provide pending changes // Perform the update