urbanairship-core/src/test/java/com/urbanairship/push/NamedUserTest.java
@Test
    public void testInit() {
        namedUser.setId("test");
        ShadowApplication.getInstance().clearStartedServices();

        namedUser.init();

        verify(mockDispatcher, atLeastOnce()).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals(NamedUserJobHandler.ACTION_UPDATE_NAMED_USER);
            }
        }));

        verify(mockDispatcher, atLeastOnce()).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals(NamedUserJobHandler.ACTION_UPDATE_TAG_GROUPS);
            }
        }));
    }
/**
     * Test init dispatches a job to update tag groups and the named user.
     */
Test init dispatches a job to update tag groups and the named user.
Test init dispatches a job to update tag groups and the named user .
@Test
    public void testInit() {
        namedUser.setId("test");
        ShadowApplication.getInstance().clearStartedServices();
        namedUser.init();
        verify(mockDispatcher, atLeastOnce()).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals(NamedUserJobHandler.ACTION_UPDATE_NAMED_USER);
            }
        }));
        verify(mockDispatcher, atLeastOnce()).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals(NamedUserJobHandler.ACTION_UPDATE_TAG_GROUPS);
            }
        }));
    }
@ Test public void testInit ( ) { namedUser . setId ( "test" ) ; ShadowApplication . getInstance ( ) . clearStartedServices ( ) ; namedUser . init ( ) ; verify ( mockDispatcher , atLeastOnce ( ) ) . dispatch ( Mockito . argThat ( new ArgumentMatcher < JobInfo > ( ) { @ Override public boolean matches ( JobInfo jobInfo ) { return jobInfo . getAction ( ) . equals ( NamedUserJobHandler . ACTION_UPDATE_NAMED_USER ) ; } } ) ) ; verify ( mockDispatcher , atLeastOnce ( ) ) . dispatch ( Mockito . argThat ( new ArgumentMatcher < JobInfo > ( ) { @ Override public boolean matches ( JobInfo jobInfo ) { return jobInfo . getAction ( ) . equals ( NamedUserJobHandler . ACTION_UPDATE_TAG_GROUPS ) ; } } ) ) ; }
Test init dispatches a job to update tag groups and the named user.
Test init dispatches a job to update tag groups and the named user .