bc.registerService(new String[] {InitialContextFactoryBuilder.class.getName(), icf.getClass().getName()}, icf, new Properties());
LdapContext backCtx = Skeleton.newMock(LdapContext.class);
InitialContextFactory fac = Skeleton.newMock(InitialContextFactory.class);
Skeleton.getSkeleton(fac).setReturnValue(
new MethodCall(InitialContextFactory.class, "getInitialContext", Hashtable.class),
backCtx);
Skeleton.getSkeleton(icf).setReturnValue(
new MethodCall(InitialContextFactoryBuilder.class, "createInitialContextFactory", Hashtable.class),
fac);
Properties props = new Properties();
props.put(JNDIConstants.BUNDLE_CONTEXT, bc);
props.put(Context.INITIAL_CONTEXT_FACTORY, "dummy.factory");
InitialLdapContext ilc = new InitialLdapContext(props, new Control[0]);
ExtendedRequest req = Skeleton.newMock(ExtendedRequest.class);
ilc.extendedOperation(req);
Skeleton.getSkeleton(backCtx).assertCalled(new MethodCall(LdapContext.class, "extendedOperation", req));
}