@Test
public void testSetBundleLocation() 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.setBundleLocation(pid, "file:/newlocation");
    
    ArgumentCaptor<String> locationArgument = ArgumentCaptor.forClass(String.class);
    verify(config).setBundleLocation(locationArgument.capture());
    
    assertEquals("file:/newlocation", locationArgument.getValue());
    
}