mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestFactoryObjectConfigModifierViewImpl.java
@Test
    public void testGetPropertiesWithoutPid()
    {
        when(m_BaseModel.getPid()).thenReturn("");
        
        UnmodifiableConfigMetatypeModel model = mockUnmodifiableConfigMetatypeModel();
        when(m_ConfigWrapper.getConfigurationDefaultsByFactoryPidAsync(CONTROLLER_ID, 
                FACTORY_CONF_NAME)).thenReturn(model);
        
        List<ModifiablePropertyModel> retList = m_SUT.getProperties();
        
        verify(m_ConfigWrapper, never()).getConfigurationByPidAsync(anyInt(), anyString());
        
        assertThat(retList, notNullValue());
        assertThat(retList.size(), is(2));
        
        ModifiablePropertyModel mod1 = retList.get(0);
        assertThat(mod1.getKey(), is(m_Property1.getKey()));
        assertThat(mod1.getName(), is(m_Property1.getName()));
        assertThat(mod1.getDescription(), is(m_Property1.getDescription()));
        assertThat(mod1.getValue(), is(m_Property1.getValue()));
        
        ModifiablePropertyModel mod2 = retList.get(1);
        assertThat(mod2.getKey(), is(m_Property2.getKey()));
        assertThat(mod2.getName(), is(m_Property2.getName()));
        assertThat(mod2.getDescription(), is(m_Property2.getDescription()));
        assertThat(mod2.getValue(), is(m_Property2.getValue()));
    }
/**
     * Verify that get properties method returns properties when object does not have a pid.
     */
Verify that get properties method returns properties when object does not have a pid.
Verify that get properties method returns properties when object does not have a pid .
@Test
    public void testGetPropertiesWithoutPid()
    {
        when(m_BaseModel.getPid()).thenReturn("");
        UnmodifiableConfigMetatypeModel model = mockUnmodifiableConfigMetatypeModel();
        when(m_ConfigWrapper.getConfigurationDefaultsByFactoryPidAsync(CONTROLLER_ID, 
                FACTORY_CONF_NAME)).thenReturn(model);
        List<ModifiablePropertyModel> retList = m_SUT.getProperties();
        verify(m_ConfigWrapper, never()).getConfigurationByPidAsync(anyInt(), anyString());
        assertThat(retList, notNullValue());
        assertThat(retList.size(), is(2));
        ModifiablePropertyModel mod1 = retList.get(0);
        assertThat(mod1.getKey(), is(m_Property1.getKey()));
        assertThat(mod1.getName(), is(m_Property1.getName()));
        assertThat(mod1.getDescription(), is(m_Property1.getDescription()));
        assertThat(mod1.getValue(), is(m_Property1.getValue()));
        ModifiablePropertyModel mod2 = retList.get(1);
        assertThat(mod2.getKey(), is(m_Property2.getKey()));
        assertThat(mod2.getName(), is(m_Property2.getName()));
        assertThat(mod2.getDescription(), is(m_Property2.getDescription()));
        assertThat(mod2.getValue(), is(m_Property2.getValue()));
    }
@ Test public void testGetPropertiesWithoutPid ( ) { when ( m_BaseModel . getPid ( ) ) . thenReturn ( "" ) ; UnmodifiableConfigMetatypeModel model = mockUnmodifiableConfigMetatypeModel ( ) ; when ( m_ConfigWrapper . getConfigurationDefaultsByFactoryPidAsync ( CONTROLLER_ID , FACTORY_CONF_NAME ) ) . thenReturn ( model ) ; List < ModifiablePropertyModel > retList = m_SUT . getProperties ( ) ; verify ( m_ConfigWrapper , never ( ) ) . getConfigurationByPidAsync ( anyInt ( ) , anyString ( ) ) ; assertThat ( retList , notNullValue ( ) ) ; assertThat ( retList . size ( ) , is ( 2 ) ) ; ModifiablePropertyModel mod1 = retList . get ( 0 ) ; assertThat ( mod1 . getKey ( ) , is ( m_Property1 . getKey ( ) ) ) ; assertThat ( mod1 . getName ( ) , is ( m_Property1 . getName ( ) ) ) ; assertThat ( mod1 . getDescription ( ) , is ( m_Property1 . getDescription ( ) ) ) ; assertThat ( mod1 . getValue ( ) , is ( m_Property1 . getValue ( ) ) ) ; ModifiablePropertyModel mod2 = retList . get ( 1 ) ; assertThat ( mod2 . getKey ( ) , is ( m_Property2 . getKey ( ) ) ) ; assertThat ( mod2 . getName ( ) , is ( m_Property2 . getName ( ) ) ) ; assertThat ( mod2 . getDescription ( ) , is ( m_Property2 . getDescription ( ) ) ) ; assertThat ( mod2 . getValue ( ) , is ( m_Property2 . getValue ( ) ) ) ; }
Verify that get properties method returns properties when object does not have a pid.
Verify that get properties method returns properties when object does not have a pid .