mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestRetrieveDeleteObsHelperImpl.java
@Test
    public void testValidateDatesNullStart()
    {
        //date obj
        Date stop = new Date(5L);
        
        //UIComponents
        ComponentSystemEvent event = mock(ComponentSystemEvent.class);
        UIComponent uiComp = mock(UIComponent.class);
        when(event.getComponent()).thenReturn(uiComp);
        UIInput uiInputStart = mock(UIInput.class);
        when(uiInputStart.getLocalValue()).thenReturn(null);
        when(uiInputStart.getClientId()).thenReturn("start");
        UIInput uiInputStop = mock(UIInput.class);
        when(uiInputStop.getLocalValue()).thenReturn(stop);
        when(uiInputStop.getClientId()).thenReturn("stop");
        
        //mock finding of start/stop inputs
        when(uiComp.findComponent("startDateRetrieve")).thenReturn(uiInputStart);
        when(uiComp.findComponent("endDateRetrieve")).thenReturn(uiInputStop);

        // validate
        m_SUT.validateDates(event);

        // verify growl messages
        verify(m_FacesContextUtil, never()).getFacesContext();
    }
/**
     * Verify ignoring null start date.
     */
Verify ignoring null start date.
Verify ignoring null start date .
@Test
    public void testValidateDatesNullStart()
    {
        Date stop = new Date(5L);
        ComponentSystemEvent event = mock(ComponentSystemEvent.class);
        UIComponent uiComp = mock(UIComponent.class);
        when(event.getComponent()).thenReturn(uiComp);
        UIInput uiInputStart = mock(UIInput.class);
        when(uiInputStart.getLocalValue()).thenReturn(null);
        when(uiInputStart.getClientId()).thenReturn("start");
        UIInput uiInputStop = mock(UIInput.class);
        when(uiInputStop.getLocalValue()).thenReturn(stop);
        when(uiInputStop.getClientId()).thenReturn("stop");
        when(uiComp.findComponent("startDateRetrieve")).thenReturn(uiInputStart);
        when(uiComp.findComponent("endDateRetrieve")).thenReturn(uiInputStop);
        m_SUT.validateDates(event);
        verify(m_FacesContextUtil, never()).getFacesContext();
    }
@ Test public void testValidateDatesNullStart ( ) { Date stop = new Date ( 5L ) ; ComponentSystemEvent event = mock ( ComponentSystemEvent . class ) ; UIComponent uiComp = mock ( UIComponent . class ) ; when ( event . getComponent ( ) ) . thenReturn ( uiComp ) ; UIInput uiInputStart = mock ( UIInput . class ) ; when ( uiInputStart . getLocalValue ( ) ) . thenReturn ( null ) ; when ( uiInputStart . getClientId ( ) ) . thenReturn ( "start" ) ; UIInput uiInputStop = mock ( UIInput . class ) ; when ( uiInputStop . getLocalValue ( ) ) . thenReturn ( stop ) ; when ( uiInputStop . getClientId ( ) ) . thenReturn ( "stop" ) ; when ( uiComp . findComponent ( "startDateRetrieve" ) ) . thenReturn ( uiInputStart ) ; when ( uiComp . findComponent ( "endDateRetrieve" ) ) . thenReturn ( uiInputStop ) ; m_SUT . validateDates ( event ) ; verify ( m_FacesContextUtil , never ( ) ) . getFacesContext ( ) ; }
Verify ignoring null start date.
Verify ignoring null start date .
//date obj //UIComponents //mock finding of start/stop inputs // validate // verify growl messages