mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestAbstractFactoryObject.java
@Test
    public void testSetProperties_NewConfig() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, FactoryObjectInformationException, ClassNotFoundException
    {
        m_SUT.initialize(m_Registry, m_FactoryProxy, factoryInternal, m_ConfigAdmin, 
                m_EventAdmin, m_PowerInternal, OBJ_UUID, OBJ_NAME, null, OBJ_BASETYPE); 
        
        // don't give SUT the PID, but set up new config that has the PID
        Configuration config = ConfigurationAdminMocker.addMockConfiguration(m_SUT, "new-pid");
        when(m_Registry.createConfiguration(Mockito.any(UUID.class), anyString(), 
                Mockito.any(AbstractFactoryObject.class))).thenReturn(config);
        
        
        Map<String, Object> props = new HashMap<>();
        props.put("test-prop", "test-value");
        m_SUT.setProperties(props);
        
        verify(m_Registry).createConfiguration(OBJ_UUID, FACTORY_PID, m_SUT);
    }
/**
     * Verify configuration is created if not there.
     */
Verify configuration is created if not there.
Verify configuration is created if not there .
@Test
    public void testSetProperties_NewConfig() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, FactoryObjectInformationException, ClassNotFoundException
    {
        m_SUT.initialize(m_Registry, m_FactoryProxy, factoryInternal, m_ConfigAdmin, 
                m_EventAdmin, m_PowerInternal, OBJ_UUID, OBJ_NAME, null, OBJ_BASETYPE); 
        Configuration config = ConfigurationAdminMocker.addMockConfiguration(m_SUT, "new-pid");
        when(m_Registry.createConfiguration(Mockito.any(UUID.class), anyString(), 
                Mockito.any(AbstractFactoryObject.class))).thenReturn(config);
        Map<String, Object> props = new HashMap<>();
        props.put("test-prop", "test-value");
        m_SUT.setProperties(props);
        verify(m_Registry).createConfiguration(OBJ_UUID, FACTORY_PID, m_SUT);
    }
@ Test public void testSetProperties_NewConfig ( ) throws IllegalArgumentException , IllegalStateException , FactoryException , FactoryObjectInformationException , ClassNotFoundException { m_SUT . initialize ( m_Registry , m_FactoryProxy , factoryInternal , m_ConfigAdmin , m_EventAdmin , m_PowerInternal , OBJ_UUID , OBJ_NAME , null , OBJ_BASETYPE ) ; Configuration config = ConfigurationAdminMocker . addMockConfiguration ( m_SUT , "new-pid" ) ; when ( m_Registry . createConfiguration ( Mockito . any ( UUID . class ) , anyString ( ) , Mockito . any ( AbstractFactoryObject . class ) ) ) . thenReturn ( config ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( "test-prop" , "test-value" ) ; m_SUT . setProperties ( props ) ; verify ( m_Registry ) . createConfiguration ( OBJ_UUID , FACTORY_PID , m_SUT ) ; }
Verify configuration is created if not there.
Verify configuration is created if not there .
// don't give SUT the PID, but set up new config that has the PID