CitrusRemoteExtension implements RemoteLoadableExtension { @Override public void register(ExtensionBuilder builder) { if (Validate.classExists(CitrusExtensionConstants.CITRUS)) { log.info("Citrus remote extension is active"); builder.service(TestEnricher.class, CitrusTestEnricher.class); builder.observer(CitrusRemoteConfigurationProducer.class); builder.observer(CitrusRemoteInstanceProducer.class); builder.observer(CitrusRemoteLifecycleHandler.class); } }  @Override void register(ExtensionBuilder builder);  }
@Test public void testRegister() throws Exception { LoadableExtension.ExtensionBuilder extensionBuilder = Mockito.mock(LoadableExtension.ExtensionBuilder.class); when(extensionBuilder.service(TestEnricher.class, CitrusTestEnricher.class)).thenReturn(extensionBuilder); when(extensionBuilder.observer(CitrusRemoteConfigurationProducer.class)).thenReturn(extensionBuilder); when(extensionBuilder.observer(CitrusRemoteInstanceProducer.class)).thenReturn(extensionBuilder); when(extensionBuilder.observer(CitrusRemoteLifecycleHandler.class)).thenReturn(extensionBuilder); extension.register(extensionBuilder); }