mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestObservationMgrImpl.java
@Test
    public void testFilteringObservationsByDateNullStart()
    {
        //date objs
        Date stop = new Date(5L);
        
        //dates
        m_SUT.setFilterByDate(true);
        m_SUT.setStartDate(null);
        m_SUT.setEndDate(stop);
        
        javax.jdo.Query queryObs = mock(javax.jdo.Query.class);
        javax.jdo.Query queryCount = mock(javax.jdo.Query.class);
        when(m_JdoStore.newJdoQuery()).thenReturn(queryObs, queryCount);
        
        //request for observations
        List<GuiObservation> list = m_SUT.getObservations().load(0, 10, null, null, null);
        
        assertThat(list.size(), is(0));
        
        //verify no calls are made
        verify(m_JdoStore, never()).executeJdoQuery(queryObs);
        verify(m_JdoStore, never()).executeGetCount(queryCount);
    }
/**
     * Verify filter of Observations by date, null start date returns no obs.
     */
Verify filter of Observations by date, null start date returns no obs.
Verify filter of Observations by date null start date returns no obs .
@Test
    public void testFilteringObservationsByDateNullStart()
    {
        Date stop = new Date(5L);
        m_SUT.setFilterByDate(true);
        m_SUT.setStartDate(null);
        m_SUT.setEndDate(stop);
        javax.jdo.Query queryObs = mock(javax.jdo.Query.class);
        javax.jdo.Query queryCount = mock(javax.jdo.Query.class);
        when(m_JdoStore.newJdoQuery()).thenReturn(queryObs, queryCount);
        List<GuiObservation> list = m_SUT.getObservations().load(0, 10, null, null, null);
        assertThat(list.size(), is(0));
        verify(m_JdoStore, never()).executeJdoQuery(queryObs);
        verify(m_JdoStore, never()).executeGetCount(queryCount);
    }
@ Test public void testFilteringObservationsByDateNullStart ( ) { Date stop = new Date ( 5L ) ; m_SUT . setFilterByDate ( true ) ; m_SUT . setStartDate ( null ) ; m_SUT . setEndDate ( stop ) ; javax . jdo . Query queryObs = mock ( javax . jdo . Query . class ) ; javax . jdo . Query queryCount = mock ( javax . jdo . Query . class ) ; when ( m_JdoStore . newJdoQuery ( ) ) . thenReturn ( queryObs , queryCount ) ; List < GuiObservation > list = m_SUT . getObservations ( ) . load ( 0 , 10 , null , null , null ) ; assertThat ( list . size ( ) , is ( 0 ) ) ; verify ( m_JdoStore , never ( ) ) . executeJdoQuery ( queryObs ) ; verify ( m_JdoStore , never ( ) ) . executeGetCount ( queryCount ) ; }
Verify filter of Observations by date, null start date returns no obs.
Verify filter of Observations by date null start date returns no obs .
//date objs //dates //request for observations //verify no calls are made