mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationQueryImpl.java
@Test
    public void testWithAsset()
    {
        // mock
        UUID uuid = UUID.randomUUID();
        Asset asset = mock(Asset.class);
        when(asset.getUuid()).thenReturn(uuid);
        
        // replay
        ObservationQuery rv = m_SUT.withAsset(asset);
        m_SUT.execute();
        
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        
        // verify return value is the same object for method chaining
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        
        // verify
        verify(query.getValue()).setFilter(String.format(ASSET_UUID_FILTER, uuid));
    }
/**
     * Verify calling with asset will set the filter properly.
     */
Verify calling with asset will set the filter properly.
Verify calling with asset will set the filter properly .
@Test
    public void testWithAsset()
    {
        UUID uuid = UUID.randomUUID();
        Asset asset = mock(Asset.class);
        when(asset.getUuid()).thenReturn(uuid);
        ObservationQuery rv = m_SUT.withAsset(asset);
        m_SUT.execute();
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        verify(query.getValue()).setFilter(String.format(ASSET_UUID_FILTER, uuid));
    }
@ Test public void testWithAsset ( ) { UUID uuid = UUID . randomUUID ( ) ; Asset asset = mock ( Asset . class ) ; when ( asset . getUuid ( ) ) . thenReturn ( uuid ) ; ObservationQuery rv = m_SUT . withAsset ( asset ) ; m_SUT . execute ( ) ; ArgumentCaptor < Query > query = ArgumentCaptor . forClass ( Query . class ) ; verify ( m_DataStore ) . executeJdoQuery ( query . capture ( ) ) ; assertThat ( ( ObservationQueryImpl ) rv , is ( m_SUT ) ) ; verify ( query . getValue ( ) ) . setFilter ( String . format ( ASSET_UUID_FILTER , uuid ) ) ; }
Verify calling with asset will set the filter properly.
Verify calling with asset will set the filter properly .
// mock // replay // verify return value is the same object for method chaining // verify