mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/mp/TestMissionRequestImpl.java
@Test
    public void testGetStreamSecondaryImageWithNoMissionName()
    {
      //Mock the image and external context.
        ExternalContext testExtContext = mock(ExternalContext.class);
        DigitalMedia image = mock(DigitalMedia.class);
        List<DigitalMedia> secondaryImages = new ArrayList<DigitalMedia>();
        secondaryImages.add(image);
        //MissionModel testMission = new MissionModel();
        MissionProgramTemplate testMission = mock(MissionProgramTemplate.class);
        Map<String, String> paramsMap = new HashMap<String, String>();
        paramsMap.put("imageId", "0");
    
        //Mocked methods.
        when(m_Tpm.getTemplate("testName")).thenReturn(testMission);
        when(testMission.getSecondaryImages()).thenReturn(secondaryImages);
        when(m_FacesContext.getExternalContext()).thenReturn(testExtContext);
        when(testExtContext.getRequestParameterMap()).thenReturn(paramsMap);
        
        StreamedContent content = m_SUT.getStreamSecondaryImage();
        
        assertThat(content.getContentType(), nullValue());
        assertThat(content.getStream(), nullValue());
    }
/**
     * Verify that if a mission name cannot be found an empty default streamed content object 
     * is returned.
     */
Verify that if a mission name cannot be found an empty default streamed content object
is returned.
Verify that if a mission name cannot be found an empty default streamed content object is returned .
@Test
    public void testGetStreamSecondaryImageWithNoMissionName()
    {
        ExternalContext testExtContext = mock(ExternalContext.class);
        DigitalMedia image = mock(DigitalMedia.class);
        List<DigitalMedia> secondaryImages = new ArrayList<DigitalMedia>();
        secondaryImages.add(image);
        MissionProgramTemplate testMission = mock(MissionProgramTemplate.class);
        Map<String, String> paramsMap = new HashMap<String, String>();
        paramsMap.put("imageId", "0");
        when(m_Tpm.getTemplate("testName")).thenReturn(testMission);
        when(testMission.getSecondaryImages()).thenReturn(secondaryImages);
        when(m_FacesContext.getExternalContext()).thenReturn(testExtContext);
        when(testExtContext.getRequestParameterMap()).thenReturn(paramsMap);
        StreamedContent content = m_SUT.getStreamSecondaryImage();
        assertThat(content.getContentType(), nullValue());
        assertThat(content.getStream(), nullValue());
    }
@ Test public void testGetStreamSecondaryImageWithNoMissionName ( ) { ExternalContext testExtContext = mock ( ExternalContext . class ) ; DigitalMedia image = mock ( DigitalMedia . class ) ; List < DigitalMedia > secondaryImages = new ArrayList < DigitalMedia > ( ) ; secondaryImages . add ( image ) ; MissionProgramTemplate testMission = mock ( MissionProgramTemplate . class ) ; Map < String , String > paramsMap = new HashMap < String , String > ( ) ; paramsMap . put ( "imageId" , "0" ) ; when ( m_Tpm . getTemplate ( "testName" ) ) . thenReturn ( testMission ) ; when ( testMission . getSecondaryImages ( ) ) . thenReturn ( secondaryImages ) ; when ( m_FacesContext . getExternalContext ( ) ) . thenReturn ( testExtContext ) ; when ( testExtContext . getRequestParameterMap ( ) ) . thenReturn ( paramsMap ) ; StreamedContent content = m_SUT . getStreamSecondaryImage ( ) ; assertThat ( content . getContentType ( ) , nullValue ( ) ) ; assertThat ( content . getStream ( ) , nullValue ( ) ) ; }
Verify that if a mission name cannot be found an empty default streamed content object
 is returned.
Verify that if a mission name cannot be found an empty default streamed content object is returned .
//Mock the image and external context. //MissionModel testMission = new MissionModel(); //Mocked methods.