mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/TestRemoteChannelLookupImpl.java
@Test
    public void testSyncChannelPersist()
    {
        //Mock the needed remote channels.
        RemoteChannel persistedChannel = mock(RemoteChannel.class);
        RemoteChannel nonPersistedChannel = mock(RemoteChannel.class);
        RemoteChannel alwaysPersistedChannel = mock(RemoteChannel.class);
        
        //Define remote system IDs
        Integer systemId1 = 75;
        Integer systemId2 = 150;
        Integer systemId3 = 225;
        
        //Sync channels
        m_SUT.syncChannel(persistedChannel, systemId1, true);
        m_SUT.syncChannel(nonPersistedChannel, systemId2, false);
        m_SUT.syncChannel(alwaysPersistedChannel, systemId3);
        
        //Verify that all channels are added to the remote lookup regardless of whether or not they should be persisted.
        assertThat(m_SUT.getChannel(systemId1), is(persistedChannel));
        assertThat(m_SUT.getChannel(systemId2), is(nonPersistedChannel));
        assertThat(m_SUT.getChannel(systemId3), is(alwaysPersistedChannel));
        
        //Verify that only remote channels with system ID 1 and 3 are persisted.
        verify(m_PersistentDataStore).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId1.toString()), Mockito.any(byte[].class));
        verify(m_PersistentDataStore, never()).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId2.toString()), Mockito.any(byte[].class));
        verify(m_PersistentDataStore).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId3.toString()), Mockito.any(byte[].class));
    }
/**
     * Verify that the syncChannel methods persist the channel when appropriate.
     */
Verify that the syncChannel methods persist the channel when appropriate.
Verify that the syncChannel methods persist the channel when appropriate .
@Test
    public void testSyncChannelPersist()
    {
        RemoteChannel persistedChannel = mock(RemoteChannel.class);
        RemoteChannel nonPersistedChannel = mock(RemoteChannel.class);
        RemoteChannel alwaysPersistedChannel = mock(RemoteChannel.class);
        Integer systemId1 = 75;
        Integer systemId2 = 150;
        Integer systemId3 = 225;
        m_SUT.syncChannel(persistedChannel, systemId1, true);
        m_SUT.syncChannel(nonPersistedChannel, systemId2, false);
        m_SUT.syncChannel(alwaysPersistedChannel, systemId3);
        assertThat(m_SUT.getChannel(systemId1), is(persistedChannel));
        assertThat(m_SUT.getChannel(systemId2), is(nonPersistedChannel));
        assertThat(m_SUT.getChannel(systemId3), is(alwaysPersistedChannel));
        verify(m_PersistentDataStore).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId1.toString()), Mockito.any(byte[].class));
        verify(m_PersistentDataStore, never()).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId2.toString()), Mockito.any(byte[].class));
        verify(m_PersistentDataStore).persist(Mockito.any(Class.class), Mockito.any(UUID.class), 
                eq(systemId3.toString()), Mockito.any(byte[].class));
    }
@ Test public void testSyncChannelPersist ( ) { RemoteChannel persistedChannel = mock ( RemoteChannel . class ) ; RemoteChannel nonPersistedChannel = mock ( RemoteChannel . class ) ; RemoteChannel alwaysPersistedChannel = mock ( RemoteChannel . class ) ; Integer systemId1 = 75 ; Integer systemId2 = 150 ; Integer systemId3 = 225 ; m_SUT . syncChannel ( persistedChannel , systemId1 , true ) ; m_SUT . syncChannel ( nonPersistedChannel , systemId2 , false ) ; m_SUT . syncChannel ( alwaysPersistedChannel , systemId3 ) ; assertThat ( m_SUT . getChannel ( systemId1 ) , is ( persistedChannel ) ) ; assertThat ( m_SUT . getChannel ( systemId2 ) , is ( nonPersistedChannel ) ) ; assertThat ( m_SUT . getChannel ( systemId3 ) , is ( alwaysPersistedChannel ) ) ; verify ( m_PersistentDataStore ) . persist ( Mockito . any ( Class . class ) , Mockito . any ( UUID . class ) , eq ( systemId1 . toString ( ) ) , Mockito . any ( byte [ ] . class ) ) ; verify ( m_PersistentDataStore , never ( ) ) . persist ( Mockito . any ( Class . class ) , Mockito . any ( UUID . class ) , eq ( systemId2 . toString ( ) ) , Mockito . any ( byte [ ] . class ) ) ; verify ( m_PersistentDataStore ) . persist ( Mockito . any ( Class . class ) , Mockito . any ( UUID . class ) , eq ( systemId3 . toString ( ) ) , Mockito . any ( byte [ ] . class ) ) ; }
Verify that the syncChannel methods persist the channel when appropriate.
Verify that the syncChannel methods persist the channel when appropriate .
//Mock the needed remote channels. //Define remote system IDs //Sync channels //Verify that all channels are added to the remote lookup regardless of whether or not they should be persisted. //Verify that only remote channels with system ID 1 and 3 are persisted.