mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetImpl.java
@Test
    public void testCaptureData()
            throws AssetException, IllegalArgumentException, PersistenceFailedException, ValidationFailedException
    {
        Observation observation = new Observation();
        when(m_Proxy.onCaptureData()).thenReturn(observation);
        assertThat(m_SUT.captureData(), is(observation));

        verify(m_WakeLock).activate();
        verify(m_Proxy).onCaptureData();
        verify(m_WakeLock).cancel();

        verify(m_ObservationStore, atLeastOnce()).persist(Mockito.any(Observation.class));

        EventAdminVerifier.assertEventByTopicAsset(m_EventAdmin, Asset.TOPIC_DATA_CAPTURED, m_SUT);
    }
/**
     * Verify that the correct sequence of calls are performed when capturing data.
     */
Verify that the correct sequence of calls are performed when capturing data.
Verify that the correct sequence of calls are performed when capturing data .
@Test
    public void testCaptureData()
            throws AssetException, IllegalArgumentException, PersistenceFailedException, ValidationFailedException
    {
        Observation observation = new Observation();
        when(m_Proxy.onCaptureData()).thenReturn(observation);
        assertThat(m_SUT.captureData(), is(observation));
        verify(m_WakeLock).activate();
        verify(m_Proxy).onCaptureData();
        verify(m_WakeLock).cancel();
        verify(m_ObservationStore, atLeastOnce()).persist(Mockito.any(Observation.class));
        EventAdminVerifier.assertEventByTopicAsset(m_EventAdmin, Asset.TOPIC_DATA_CAPTURED, m_SUT);
    }
@ Test public void testCaptureData ( ) throws AssetException , IllegalArgumentException , PersistenceFailedException , ValidationFailedException { Observation observation = new Observation ( ) ; when ( m_Proxy . onCaptureData ( ) ) . thenReturn ( observation ) ; assertThat ( m_SUT . captureData ( ) , is ( observation ) ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_Proxy ) . onCaptureData ( ) ; verify ( m_WakeLock ) . cancel ( ) ; verify ( m_ObservationStore , atLeastOnce ( ) ) . persist ( Mockito . any ( Observation . class ) ) ; EventAdminVerifier . assertEventByTopicAsset ( m_EventAdmin , Asset . TOPIC_DATA_CAPTURED , m_SUT ) ; }
Verify that the correct sequence of calls are performed when capturing data.
Verify that the correct sequence of calls are performed when capturing data .