mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestAddressManagerServiceImpl.java
@Test
    public void testCheckAddressAlreadyExists() throws CCommException, FactoryException, IOException, AssetException,
            IllegalArgumentException
    {
        Address a = m_SUT.getOrCreateAddress("Base:blah");
        Map<String, Object> props = new HashMap<>();
        props.put("prop", "blah");
        when(m_FactoryServiceContext.getRegistry()).thenReturn(m_Registry);
        when(m_FactoryServiceContext.getRegistry().getObjectsByProductType(anyString())).thenReturn(m_RegistryObjects);
        when(a.equalProperties(props)).thenReturn(true);
        
        //verify address is created, by the address's descriptive string
        assertThat(m_SUT.checkAddressAlreadyExists("Base:blah"), is(true));
    }
/**
     * Verify that a created address can be verified by descriptive string and the address object itself.
     */
Verify that a created address can be verified by descriptive string and the address object itself.
Verify that a created address can be verified by descriptive string and the address object itself .
@Test
    public void testCheckAddressAlreadyExists() throws CCommException, FactoryException, IOException, AssetException,
            IllegalArgumentException
    {
        Address a = m_SUT.getOrCreateAddress("Base:blah");
        Map<String, Object> props = new HashMap<>();
        props.put("prop", "blah");
        when(m_FactoryServiceContext.getRegistry()).thenReturn(m_Registry);
        when(m_FactoryServiceContext.getRegistry().getObjectsByProductType(anyString())).thenReturn(m_RegistryObjects);
        when(a.equalProperties(props)).thenReturn(true);
        assertThat(m_SUT.checkAddressAlreadyExists("Base:blah"), is(true));
    }
@ Test public void testCheckAddressAlreadyExists ( ) throws CCommException , FactoryException , IOException , AssetException , IllegalArgumentException { Address a = m_SUT . getOrCreateAddress ( "Base:blah" ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( "prop" , "blah" ) ; when ( m_FactoryServiceContext . getRegistry ( ) ) . thenReturn ( m_Registry ) ; when ( m_FactoryServiceContext . getRegistry ( ) . getObjectsByProductType ( anyString ( ) ) ) . thenReturn ( m_RegistryObjects ) ; when ( a . equalProperties ( props ) ) . thenReturn ( true ) ; assertThat ( m_SUT . checkAddressAlreadyExists ( "Base:blah" ) , is ( true ) ) ; }
Verify that a created address can be verified by descriptive string and the address object itself.
Verify that a created address can be verified by descriptive string and the address object itself .
//verify address is created, by the address's descriptive string