mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/mp/TestMissionLoadSelected.java
@Test
    public void testLocalLoadMissionTemplateNotFound() throws ObjectConverterException
    {
        //mocked model
        MissionModel model = getModelA();     
        //mock mission manager behavior
        when(m_MissionManager.getMission()).thenReturn(model);
        
        //mock controller
        ControllerModel controller = mock(ControllerModel.class);
        when(controller.getId()).thenReturn(123);
        //mock active controller
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        when(m_ActiveController.getActiveController()).thenReturn(controller);
        
        //mock template program manager behavior
        when(m_TemplateManager.getTemplate(model.getName())).thenReturn(null);
        
        //try to load mock mission, capture string returned
        try
        {
            m_SUT.loadMission();
            fail("Expecting exception");
        }
        catch (IllegalArgumentException exception)
        {
            //expecting exception
        }
        //verify message sender never sent messages
        verify(m_MissionProgMgr, never()).queueMessage(eq(123), Mockito.any(Message.class), 
                Mockito.any(MissionProgrammingMessageType.class));
    }
/**
     * Test loading a template that is supposed to be local, but is not.
     * 
     * Verify message sender does NOT send template.
     * 
     * Verify message sender does NOT send parameters.
     */
Test loading a template that is supposed to be local, but is not.

Verify message sender does NOT send template.

Verify message sender does NOT send parameters.
Test loading a template that is supposed to be local but is not . Verify message sender does NOT send template . Verify message sender does NOT send parameters .
@Test
    public void testLocalLoadMissionTemplateNotFound() throws ObjectConverterException
    {
        MissionModel model = getModelA();     
        when(m_MissionManager.getMission()).thenReturn(model);
        ControllerModel controller = mock(ControllerModel.class);
        when(controller.getId()).thenReturn(123);
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        when(m_ActiveController.getActiveController()).thenReturn(controller);
        when(m_TemplateManager.getTemplate(model.getName())).thenReturn(null);
        try
        {
            m_SUT.loadMission();
            fail("Expecting exception");
        }
        catch (IllegalArgumentException exception)
        {
        }
        verify(m_MissionProgMgr, never()).queueMessage(eq(123), Mockito.any(Message.class), 
                Mockito.any(MissionProgrammingMessageType.class));
    }
@ Test public void testLocalLoadMissionTemplateNotFound ( ) throws ObjectConverterException { MissionModel model = getModelA ( ) ; when ( m_MissionManager . getMission ( ) ) . thenReturn ( model ) ; ControllerModel controller = mock ( ControllerModel . class ) ; when ( controller . getId ( ) ) . thenReturn ( 123 ) ; when ( m_ActiveController . isActiveControllerSet ( ) ) . thenReturn ( true ) ; when ( m_ActiveController . getActiveController ( ) ) . thenReturn ( controller ) ; when ( m_TemplateManager . getTemplate ( model . getName ( ) ) ) . thenReturn ( null ) ; try { m_SUT . loadMission ( ) ; fail ( "Expecting exception" ) ; } catch ( IllegalArgumentException exception ) { } verify ( m_MissionProgMgr , never ( ) ) . queueMessage ( eq ( 123 ) , Mockito . any ( Message . class ) , Mockito . any ( MissionProgrammingMessageType . class ) ) ; }
Test loading a template that is supposed to be local, but is not.
Test loading a template that is supposed to be local but is not .
//mocked model //mock mission manager behavior //mock controller //mock active controller //mock template program manager behavior //try to load mock mission, capture string returned //expecting exception //verify message sender never sent messages