@Test
public void testDelete() 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);
    
    when(admin.getConfiguration(pid, null)).thenReturn(config);
    
    ConfigurationAdmin mbean = new ConfigurationAdmin(admin);
    mbean.delete(pid);
    verify(config).delete();
    
    reset(config);
    
    when(admin.getConfiguration(pid, "location")).thenReturn(config);
    mbean.deleteForLocation(pid, "location");
    verify(config).delete();
    
}