@Test public void executePlanningRest() { when(config.isRest()).thenReturn(true); String expectedUri = SERVER_URL + "/" + TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + USER_ID; doReturn(planningExecutionResult) .when(runtimeClient) .makeHttpPostRequestAndCreateCustomResponse(eq(expectedUri), eq(planningItemList), eq(PlanningExecutionResult.class)); PlanningExecutionResult result = runtimeClient.executePlanning(planningItemList, USER_ID); assertEquals(planningExecutionResult, result); }
@Override public PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId) { if (config.isRest()) { final String uri = TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + userId; return makeHttpPostRequestAndCreateCustomResponse(RestURI.build(loadBalancer.getUrl(), uri, Collections.emptyMap()), planningItemList, PlanningExecutionResult.class); } else { throw new KieServicesException("JMS protocol is not implemented for this service."); } }
TaskAssigningRuntimeClientImpl extends AbstractKieServicesClientImpl implements TaskAssigningRuntimeClient { @Override public PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId) { if (config.isRest()) { final String uri = TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + userId; return makeHttpPostRequestAndCreateCustomResponse(RestURI.build(loadBalancer.getUrl(), uri, Collections.emptyMap()), planningItemList, PlanningExecutionResult.class); } else { throw new KieServicesException("JMS protocol is not implemented for this service."); } } }
TaskAssigningRuntimeClientImpl extends AbstractKieServicesClientImpl implements TaskAssigningRuntimeClient { @Override public PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId) { if (config.isRest()) { final String uri = TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + userId; return makeHttpPostRequestAndCreateCustomResponse(RestURI.build(loadBalancer.getUrl(), uri, Collections.emptyMap()), planningItemList, PlanningExecutionResult.class); } else { throw new KieServicesException("JMS protocol is not implemented for this service."); } } TaskAssigningRuntimeClientImpl(KieServicesConfiguration config);  TaskAssigningRuntimeClientImpl(KieServicesConfiguration config, ClassLoader classLoader); }
TaskAssigningRuntimeClientImpl extends AbstractKieServicesClientImpl implements TaskAssigningRuntimeClient { @Override public PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId) { if (config.isRest()) { final String uri = TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + userId; return makeHttpPostRequestAndCreateCustomResponse(RestURI.build(loadBalancer.getUrl(), uri, Collections.emptyMap()), planningItemList, PlanningExecutionResult.class); } else { throw new KieServicesException("JMS protocol is not implemented for this service."); } } TaskAssigningRuntimeClientImpl(KieServicesConfiguration config);  TaskAssigningRuntimeClientImpl(KieServicesConfiguration config, ClassLoader classLoader); @Override PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId); @Override TaskDataList findTasks(Long fromTaskId, List<String> status, LocalDateTime fromLastModificationDate,
                                  Integer page, Integer pageSize,
                                  TaskInputVariablesReadMode inputVariablesReadMode); @Override TaskDataList findTasks(Long fromTaskId, List<String> status, LocalDateTime fromLastModificationDate,
                                  Integer page, Integer pageSize); KieServicesConfiguration getConfig(); }
TaskAssigningRuntimeClientImpl extends AbstractKieServicesClientImpl implements TaskAssigningRuntimeClient { @Override public PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId) { if (config.isRest()) { final String uri = TASK_ASSIGNING_RUNTIME_URI + "/" + TASK_ASSIGNING_EXECUTE_PLANNING_URI + "?user=" + userId; return makeHttpPostRequestAndCreateCustomResponse(RestURI.build(loadBalancer.getUrl(), uri, Collections.emptyMap()), planningItemList, PlanningExecutionResult.class); } else { throw new KieServicesException("JMS protocol is not implemented for this service."); } } TaskAssigningRuntimeClientImpl(KieServicesConfiguration config);  TaskAssigningRuntimeClientImpl(KieServicesConfiguration config, ClassLoader classLoader); @Override PlanningExecutionResult executePlanning(PlanningItemList planningItemList, String userId); @Override TaskDataList findTasks(Long fromTaskId, List<String> status, LocalDateTime fromLastModificationDate,
                                  Integer page, Integer pageSize,
                                  TaskInputVariablesReadMode inputVariablesReadMode); @Override TaskDataList findTasks(Long fromTaskId, List<String> status, LocalDateTime fromLastModificationDate,
                                  Integer page, Integer pageSize); KieServicesConfiguration getConfig();  }