mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestLinkLayerRegistryCallback.java
@Test
    public void testPhysNotFoundOnObjectRemoved()
    {
        PhysicalLink phys = mock(PhysicalLink.class);
        String physName = "name";
        when(phys.getName()).thenReturn(physName);
        
        //mock exception
        doThrow(new IllegalArgumentException()).when(phys).release();

        //link 
        LinkLayerInternal link = mock(LinkLayerInternal.class);
        when(link.getPhysicalLink()).thenReturn(phys);
        
        m_SUT.onRemovedObject(link);
        
        verify(m_Log).error(Mockito.any(IllegalArgumentException.class), 
                eq("Unable to release physical link [%s]"), eq(physName));
    }
/**
     * Verify catching of exception if physical link is not found when link is removed.
     */
Verify catching of exception if physical link is not found when link is removed.
Verify catching of exception if physical link is not found when link is removed .
@Test
    public void testPhysNotFoundOnObjectRemoved()
    {
        PhysicalLink phys = mock(PhysicalLink.class);
        String physName = "name";
        when(phys.getName()).thenReturn(physName);
        doThrow(new IllegalArgumentException()).when(phys).release();
        LinkLayerInternal link = mock(LinkLayerInternal.class);
        when(link.getPhysicalLink()).thenReturn(phys);
        m_SUT.onRemovedObject(link);
        verify(m_Log).error(Mockito.any(IllegalArgumentException.class), 
                eq("Unable to release physical link [%s]"), eq(physName));
    }
@ Test public void testPhysNotFoundOnObjectRemoved ( ) { PhysicalLink phys = mock ( PhysicalLink . class ) ; String physName = "name" ; when ( phys . getName ( ) ) . thenReturn ( physName ) ; doThrow ( new IllegalArgumentException ( ) ) . when ( phys ) . release ( ) ; LinkLayerInternal link = mock ( LinkLayerInternal . class ) ; when ( link . getPhysicalLink ( ) ) . thenReturn ( phys ) ; m_SUT . onRemovedObject ( link ) ; verify ( m_Log ) . error ( Mockito . any ( IllegalArgumentException . class ) , eq ( "Unable to release physical link [%s]" ) , eq ( physName ) ) ; }
Verify catching of exception if physical link is not found when link is removed.
Verify catching of exception if physical link is not found when link is removed .
//mock exception //link 