@Test
public void testGetProperties() throws Exception {

    org.osgi.service.cm.ConfigurationAdmin admin = mock(org.osgi.service.cm.ConfigurationAdmin.class);
    String pid = "org.apache.aries.jmx.mock";
    Configuration config = mock(Configuration.class);
    
    Dictionary<String, Object> props = new Hashtable<String, Object>();
    props.put("one", "value");
    props.put("two", 2);
    when(admin.getConfiguration(eq(pid), anyString())).thenReturn(config);
    when(config.getProperties()).thenReturn(props);
    
    ConfigurationAdmin mbean = new ConfigurationAdmin(admin);
    
    TabularData properties = mbean.getPropertiesForLocation(pid, null);
    assertNotNull(properties);
    assertEquals(PROPERTIES_TYPE, properties.getTabularType());
    assertEquals(2, properties.values().size());
    PropertyData<? extends Object> oneData = PropertyData.from(properties.get(new Object[]{ "one"}));
    assertEquals("value", oneData.getValue());
    PropertyData<? extends Object> twoData = PropertyData.from(properties.get(new Object[]{ "two"}));
    assertEquals(2, twoData.getValue());
    assertEquals("2", twoData.getEncodedValue());
    
}