@Test public void getAppComponents() { TaskAssigningRuntimeServiceBase serviceMock = mock(TaskAssigningRuntimeServiceBase.class); KieServerRegistry registryMock = mock(KieServerRegistry.class); TaskAssigningRuntimeRestApplicationComponentsService componentsService = new TaskAssigningRuntimeRestApplicationComponentsService(); Collection<Object> result = componentsService.getAppComponents(TaskAssigningRuntimeKieServerExtension.EXTENSION_NAME, SupportedTransports.REST, serviceMock, registryMock); assertEquals(1, result.size()); assertTrue(result.iterator().next() instanceof TaskAssigningRuntimeResource); }
@Override public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } TaskAssigningRuntimeServiceBase taskAssigningRuntimeServiceBase = null; KieServerRegistry context = null; for (Object object : services) { if (object != null) { if (TaskAssigningRuntimeServiceBase.class.isAssignableFrom(object.getClass())) { taskAssigningRuntimeServiceBase = (TaskAssigningRuntimeServiceBase) object; } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) { context = (KieServerRegistry) object; } } } return Collections.singleton(new TaskAssigningRuntimeResource(taskAssigningRuntimeServiceBase, context)); }
TaskAssigningRuntimeRestApplicationComponentsService implements KieServerApplicationComponentsService { @Override public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } TaskAssigningRuntimeServiceBase taskAssigningRuntimeServiceBase = null; KieServerRegistry context = null; for (Object object : services) { if (object != null) { if (TaskAssigningRuntimeServiceBase.class.isAssignableFrom(object.getClass())) { taskAssigningRuntimeServiceBase = (TaskAssigningRuntimeServiceBase) object; } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) { context = (KieServerRegistry) object; } } } return Collections.singleton(new TaskAssigningRuntimeResource(taskAssigningRuntimeServiceBase, context)); } }
TaskAssigningRuntimeRestApplicationComponentsService implements KieServerApplicationComponentsService { @Override public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } TaskAssigningRuntimeServiceBase taskAssigningRuntimeServiceBase = null; KieServerRegistry context = null; for (Object object : services) { if (object != null) { if (TaskAssigningRuntimeServiceBase.class.isAssignableFrom(object.getClass())) { taskAssigningRuntimeServiceBase = (TaskAssigningRuntimeServiceBase) object; } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) { context = (KieServerRegistry) object; } } } return Collections.singleton(new TaskAssigningRuntimeResource(taskAssigningRuntimeServiceBase, context)); }  }
TaskAssigningRuntimeRestApplicationComponentsService implements KieServerApplicationComponentsService { @Override public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } TaskAssigningRuntimeServiceBase taskAssigningRuntimeServiceBase = null; KieServerRegistry context = null; for (Object object : services) { if (object != null) { if (TaskAssigningRuntimeServiceBase.class.isAssignableFrom(object.getClass())) { taskAssigningRuntimeServiceBase = (TaskAssigningRuntimeServiceBase) object; } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) { context = (KieServerRegistry) object; } } } return Collections.singleton(new TaskAssigningRuntimeResource(taskAssigningRuntimeServiceBase, context)); }  @Override Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services); }
TaskAssigningRuntimeRestApplicationComponentsService implements KieServerApplicationComponentsService { @Override public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } TaskAssigningRuntimeServiceBase taskAssigningRuntimeServiceBase = null; KieServerRegistry context = null; for (Object object : services) { if (object != null) { if (TaskAssigningRuntimeServiceBase.class.isAssignableFrom(object.getClass())) { taskAssigningRuntimeServiceBase = (TaskAssigningRuntimeServiceBase) object; } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) { context = (KieServerRegistry) object; } } } return Collections.singleton(new TaskAssigningRuntimeResource(taskAssigningRuntimeServiceBase, context)); }  @Override Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services);  }