EndpointDescription epd = c.createMock(EndpointDescription.class);
RemoteServiceAdmin rsa = c.createMock(RemoteServiceAdmin.class);
final ImportRegistration ireg = c.createMock(ImportRegistration.class);
ImportReference iref = c.createMock(ImportReference.class);
EasyMock.expect(rsa.importService(EasyMock.eq(epd))).andAnswer(new IAnswer<ImportRegistration>( ) {
public ImportRegistration answer() throws Throwable {
sema.release();
return ireg;
}
}).once();
EasyMock.expect(ireg.getImportReference()).andReturn(iref).anyTimes();
EasyMock.expect(iref.getImportedEndpoint()).andReturn(epd).anyTimes();
c.replay();
RemoteServiceAdminList rsaList = new RemoteServiceAdminList(bc);