mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationQueryImpl.java
@Test
    public void testAssetTypeAlreadySet()
    {
        // replay
        m_SUT.withAssetType("something");
        
        // replay with the same type, should pass
        m_SUT.withAssetType("something");
        
        // replay each asset method and verify it fails
        try
        {
            m_SUT.withAssetType("something else");
            fail("Expecting exception since already restriced to a different asset type");
        }
        catch (IllegalStateException e)
        {
        }
        
        UUID uuid = UUID.randomUUID();
        try
        {
            m_SUT.withAssetUuid(uuid);
            fail("Expecting exception since already restriced to an asset type");
        }
        catch (IllegalStateException e)
        {
        }
        
        try
        {
            Asset asset = mock(Asset.class);
            when(asset.getUuid()).thenReturn(uuid);
            m_SUT.withAsset(asset);
            fail("Expecting exception since already restriced to an asset type");
        }
        catch (IllegalStateException e)
        {
        }
    }
/**
     * Verify if the asset type is already set that subsequent calls to set the id or type will fail.
     */
Verify if the asset type is already set that subsequent calls to set the id or type will fail.
Verify if the asset type is already set that subsequent calls to set the id or type will fail .
@Test
    public void testAssetTypeAlreadySet()
    {
        m_SUT.withAssetType("something");
         with the same type, should pass
        m_SUT.withAssetType("something");
         each asset method and verify it fails
        try
        {
            m_SUT.withAssetType("something else");
            fail("Expecting exception since already restriced to a different asset type");
        }
        catch (IllegalStateException e)
        {
        }
        UUID uuid = UUID.randomUUID();
        try
        {
            m_SUT.withAssetUuid(uuid);
            fail("Expecting exception since already restriced to an asset type");
        }
        catch (IllegalStateException e)
        {
        }
        try
        {
            Asset asset = mock(Asset.class);
            when(asset.getUuid()).thenReturn(uuid);
            m_SUT.withAsset(asset);
            fail("Expecting exception since already restriced to an asset type");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testAssetTypeAlreadySet ( ) { m_SUT . withAssetType ( "something" ) ; m_SUT . withAssetType ( "something" ) ; try { m_SUT . withAssetType ( "something else" ) ; fail ( "Expecting exception since already restriced to a different asset type" ) ; } catch ( IllegalStateException e ) { } UUID uuid = UUID . randomUUID ( ) ; try { m_SUT . withAssetUuid ( uuid ) ; fail ( "Expecting exception since already restriced to an asset type" ) ; } catch ( IllegalStateException e ) { } try { Asset asset = mock ( Asset . class ) ; when ( asset . getUuid ( ) ) . thenReturn ( uuid ) ; m_SUT . withAsset ( asset ) ; fail ( "Expecting exception since already restriced to an asset type" ) ; } catch ( IllegalStateException e ) { } }
Verify if the asset type is already set that subsequent calls to set the id or type will fail.
Verify if the asset type is already set that subsequent calls to set the id or type will fail .
// replay // replay with the same type, should pass // replay each asset method and verify it fails