@RunWithCustomExecutor @Test(expected = WorkerNotFoundClientException.class) public void submitNotFound() throws Exception { VitamThreadUtils.getVitamSession().setRequestId(DUMMY_REQUEST_ID); when(mock.post()).thenReturn(Response.status(Response.Status.NOT_FOUND).build()); client.submitStep(new DescriptionStep(new Step(), WorkerParametersFactory.newWorkerParameters())); }
@Override public ItemStatus submitStep(DescriptionStep step) throws WorkerNotFoundClientException, WorkerServerClientException { VitamThreadUtils.getVitamSession().checkValidRequestId(); VitamRequestBuilder request = post() .withPath("/tasks") .withBody(step, DATA_MUST_HAVE_A_VALID_VALUE) .withJson(); try (Response response = make(request)) { return handleCommonResponseStatus(step, response); } catch (VitamClientInternalException e) { throw new WorkerServerClientException(e); } }
WorkerClientRest extends DefaultClient implements WorkerClient { @Override public ItemStatus submitStep(DescriptionStep step) throws WorkerNotFoundClientException, WorkerServerClientException { VitamThreadUtils.getVitamSession().checkValidRequestId(); VitamRequestBuilder request = post() .withPath("/tasks") .withBody(step, DATA_MUST_HAVE_A_VALID_VALUE) .withJson(); try (Response response = make(request)) { return handleCommonResponseStatus(step, response); } catch (VitamClientInternalException e) { throw new WorkerServerClientException(e); } } }
WorkerClientRest extends DefaultClient implements WorkerClient { @Override public ItemStatus submitStep(DescriptionStep step) throws WorkerNotFoundClientException, WorkerServerClientException { VitamThreadUtils.getVitamSession().checkValidRequestId(); VitamRequestBuilder request = post() .withPath("/tasks") .withBody(step, DATA_MUST_HAVE_A_VALID_VALUE) .withJson(); try (Response response = make(request)) { return handleCommonResponseStatus(step, response); } catch (VitamClientInternalException e) { throw new WorkerServerClientException(e); } } WorkerClientRest(WorkerClientFactory factory); }
WorkerClientRest extends DefaultClient implements WorkerClient { @Override public ItemStatus submitStep(DescriptionStep step) throws WorkerNotFoundClientException, WorkerServerClientException { VitamThreadUtils.getVitamSession().checkValidRequestId(); VitamRequestBuilder request = post() .withPath("/tasks") .withBody(step, DATA_MUST_HAVE_A_VALID_VALUE) .withJson(); try (Response response = make(request)) { return handleCommonResponseStatus(step, response); } catch (VitamClientInternalException e) { throw new WorkerServerClientException(e); } } WorkerClientRest(WorkerClientFactory factory); @Override ItemStatus submitStep(DescriptionStep step); }
WorkerClientRest extends DefaultClient implements WorkerClient { @Override public ItemStatus submitStep(DescriptionStep step) throws WorkerNotFoundClientException, WorkerServerClientException { VitamThreadUtils.getVitamSession().checkValidRequestId(); VitamRequestBuilder request = post() .withPath("/tasks") .withBody(step, DATA_MUST_HAVE_A_VALID_VALUE) .withJson(); try (Response response = make(request)) { return handleCommonResponseStatus(step, response); } catch (VitamClientInternalException e) { throw new WorkerServerClientException(e); } } WorkerClientRest(WorkerClientFactory factory); @Override ItemStatus submitStep(DescriptionStep step);  }