mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetImpl.java
@Test
    public void testPerformBitAssetException() throws AssetException
    {
        when(m_Proxy.onPerformBit()).thenThrow(new AssetException("exception"));

        m_SUT.performBit();

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

        Observation status = m_SUT.getLastStatus();

        assertThat(status.isSetStatus(), notNullValue());
        assertThat(status.getStatus().getSummaryStatus().getSummary(), is(SummaryStatusEnum.BAD));
        assertThat(status.getStatus().getSummaryStatus().getDescription(), is("Failed to perform BIT"));
    }
/**
     * Verify an exception is thrown if the asset fails during BIT.
     */
Verify an exception is thrown if the asset fails during BIT.
Verify an exception is thrown if the asset fails during BIT .
@Test
    public void testPerformBitAssetException() throws AssetException
    {
        when(m_Proxy.onPerformBit()).thenThrow(new AssetException("exception"));
        m_SUT.performBit();
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
        Observation status = m_SUT.getLastStatus();
        assertThat(status.isSetStatus(), notNullValue());
        assertThat(status.getStatus().getSummaryStatus().getSummary(), is(SummaryStatusEnum.BAD));
        assertThat(status.getStatus().getSummaryStatus().getDescription(), is("Failed to perform BIT"));
    }
@ Test public void testPerformBitAssetException ( ) throws AssetException { when ( m_Proxy . onPerformBit ( ) ) . thenThrow ( new AssetException ( "exception" ) ) ; m_SUT . performBit ( ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; Observation status = m_SUT . getLastStatus ( ) ; assertThat ( status . isSetStatus ( ) , notNullValue ( ) ) ; assertThat ( status . getStatus ( ) . getSummaryStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . BAD ) ) ; assertThat ( status . getStatus ( ) . getSummaryStatus ( ) . getDescription ( ) , is ( "Failed to perform BIT" ) ) ; }
Verify an exception is thrown if the asset fails during BIT.
Verify an exception is thrown if the asset fails during BIT .