mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryRegistry.java
@Test
    public void testRetrieveDeps_MissingDepNotRequried()
    {
        RegistryDependency dep = mock(RegistryDependency.class);
        when(dep.getObjectNameProperty()).thenReturn("dep");
        when(dep.isRequired()).thenReturn(false);

        // have call back always say dep is missing
        when(m_Callback.retrieveRegistryDependencies()).thenReturn(Lists.newArrayList(dep));
        m_SUT.initialize(m_FactoryService, m_ServiceProxy, m_Callback);

        final Dictionary<String, Object> props = new Hashtable<>();

        assertThat(m_SUT.isSatisfied(UUID.randomUUID(), props), is(DependencyState.SATISFIED));
    }
/**
     * Verify that if a dep is not required and missing, deps are considered satisfied.
     */
Verify that if a dep is not required and missing, deps are considered satisfied.
Verify that if a dep is not required and missing deps are considered satisfied .
@Test
    public void testRetrieveDeps_MissingDepNotRequried()
    {
        RegistryDependency dep = mock(RegistryDependency.class);
        when(dep.getObjectNameProperty()).thenReturn("dep");
        when(dep.isRequired()).thenReturn(false);
        when(m_Callback.retrieveRegistryDependencies()).thenReturn(Lists.newArrayList(dep));
        m_SUT.initialize(m_FactoryService, m_ServiceProxy, m_Callback);
        final Dictionary<String, Object> props = new Hashtable<>();
        assertThat(m_SUT.isSatisfied(UUID.randomUUID(), props), is(DependencyState.SATISFIED));
    }
@ Test public void testRetrieveDeps_MissingDepNotRequried ( ) { RegistryDependency dep = mock ( RegistryDependency . class ) ; when ( dep . getObjectNameProperty ( ) ) . thenReturn ( "dep" ) ; when ( dep . isRequired ( ) ) . thenReturn ( false ) ; when ( m_Callback . retrieveRegistryDependencies ( ) ) . thenReturn ( Lists . newArrayList ( dep ) ) ; m_SUT . initialize ( m_FactoryService , m_ServiceProxy , m_Callback ) ; final Dictionary < String , Object > props = new Hashtable < > ( ) ; assertThat ( m_SUT . isSatisfied ( UUID . randomUUID ( ) , props ) , is ( DependencyState . SATISFIED ) ) ; }
Verify that if a dep is not required and missing, deps are considered satisfied.
Verify that if a dep is not required and missing deps are considered satisfied .
// have call back always say dep is missing