mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestAddressManagerServiceImpl.java
@Test
    public void testCreateWithName() throws CCommException, IllegalArgumentException,
        FactoryObjectInformationException, FactoryException, ClassNotFoundException
    {
        when(m_AddressFactoryObjectDataManager.getName(Mockito.any(UUID.class))).thenReturn("creationAddressName");
        m_SUT.getOrCreateAddress("Base:abc", "creationAddressName");

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("prop", "abc");
        verify(m_Registry).createNewObject(m_Factory, "creationAddressName", props);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
/*
     * Test that address name is correctly set if provided at creation.
     */
Test that address name is correctly set if provided at creation.
Test that address name is correctly set if provided at creation .
@Test
    public void testCreateWithName() throws CCommException, IllegalArgumentException,
        FactoryObjectInformationException, FactoryException, ClassNotFoundException
    {
        when(m_AddressFactoryObjectDataManager.getName(Mockito.any(UUID.class))).thenReturn("creationAddressName");
        m_SUT.getOrCreateAddress("Base:abc", "creationAddressName");
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("prop", "abc");
        verify(m_Registry).createNewObject(m_Factory, "creationAddressName", props);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
@ Test public void testCreateWithName ( ) throws CCommException , IllegalArgumentException , FactoryObjectInformationException , FactoryException , ClassNotFoundException { when ( m_AddressFactoryObjectDataManager . getName ( Mockito . any ( UUID . class ) ) ) . thenReturn ( "creationAddressName" ) ; m_SUT . getOrCreateAddress ( "Base:abc" , "creationAddressName" ) ; Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( "prop" , "abc" ) ; verify ( m_Registry ) . createNewObject ( m_Factory , "creationAddressName" , props ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; }
Test that address name is correctly set if provided at creation.
Test that address name is correctly set if provided at creation .