mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/controller/TestControllerMgrImpl.java
@Test
    public void testChannelHelperChannelUpdatedUnknownEncryptType()
    {
        int contId = 123;
        
        RemoteChannel channel = mock(RemoteChannel.class);
        Map<Integer, Set<RemoteChannel>> remoteAns = new HashMap<>();
        Set<RemoteChannel> setRC = new HashSet<>();
        setRC.add(channel);
        
        remoteAns.put(contId, setRC);
        
        when(m_ChannelLookup.getAllChannels()).thenReturn(remoteAns);
        
        Event event = createBasicChannelUpdatedEvent(channel, contId);
        
        m_ChannelHelper.handleEvent(event);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        assertThat(eventCaptor.getValue().getTopic(), is(ControllerMgr.TOPIC_CONTROLLER_ADDED));
        assertThat((int)eventCaptor.getValue().getProperty(
                SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is(contId));
        
        ControllerModel model = m_SUT.getController(contId);
        assertThat(model, notNullValue());
        assertThat(model.needsCleanupRequest(), is(true));

        verify(m_MessageFactory, never()).createEventAdminMessage(EventAdminMessageType.CleanupRequest, null);
        verify(m_MessageWrapper, never()).queue(contId, null);
    }
/**
     * Verify when a channel added event is handled and that messages to request controller information are sent since
     * encryption type is unknown.
     */
Verify when a channel added event is handled and that messages to request controller information are sent since
encryption type is unknown.
Verify when a channel added event is handled and that messages to request controller information are sent since encryption type is unknown .
@Test
    public void testChannelHelperChannelUpdatedUnknownEncryptType()
    {
        int contId = 123;
        RemoteChannel channel = mock(RemoteChannel.class);
        Map<Integer, Set<RemoteChannel>> remoteAns = new HashMap<>();
        Set<RemoteChannel> setRC = new HashSet<>();
        setRC.add(channel);
        remoteAns.put(contId, setRC);
        when(m_ChannelLookup.getAllChannels()).thenReturn(remoteAns);
        Event event = createBasicChannelUpdatedEvent(channel, contId);
        m_ChannelHelper.handleEvent(event);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        assertThat(eventCaptor.getValue().getTopic(), is(ControllerMgr.TOPIC_CONTROLLER_ADDED));
        assertThat((int)eventCaptor.getValue().getProperty(
                SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is(contId));
        ControllerModel model = m_SUT.getController(contId);
        assertThat(model, notNullValue());
        assertThat(model.needsCleanupRequest(), is(true));
        verify(m_MessageFactory, never()).createEventAdminMessage(EventAdminMessageType.CleanupRequest, null);
        verify(m_MessageWrapper, never()).queue(contId, null);
    }
@ Test public void testChannelHelperChannelUpdatedUnknownEncryptType ( ) { int contId = 123 ; RemoteChannel channel = mock ( RemoteChannel . class ) ; Map < Integer , Set < RemoteChannel > > remoteAns = new HashMap < > ( ) ; Set < RemoteChannel > setRC = new HashSet < > ( ) ; setRC . add ( channel ) ; remoteAns . put ( contId , setRC ) ; when ( m_ChannelLookup . getAllChannels ( ) ) . thenReturn ( remoteAns ) ; Event event = createBasicChannelUpdatedEvent ( channel , contId ) ; m_ChannelHelper . handleEvent ( event ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; assertThat ( eventCaptor . getValue ( ) . getTopic ( ) , is ( ControllerMgr . TOPIC_CONTROLLER_ADDED ) ) ; assertThat ( ( int ) eventCaptor . getValue ( ) . getProperty ( SharedPropertyConstants . EVENT_PROP_CONTROLLER_ID ) , is ( contId ) ) ; ControllerModel model = m_SUT . getController ( contId ) ; assertThat ( model , notNullValue ( ) ) ; assertThat ( model . needsCleanupRequest ( ) , is ( true ) ) ; verify ( m_MessageFactory , never ( ) ) . createEventAdminMessage ( EventAdminMessageType . CleanupRequest , null ) ; verify ( m_MessageWrapper , never ( ) ) . queue ( contId , null ) ; }
Verify when a channel added event is handled and that messages to request controller information are sent since
 encryption type is unknown.
Verify when a channel added event is handled and that messages to request controller information are sent since encryption type is unknown .