@Test public void givenNonEmptyLocalFileThenUploadWithSuccess() throws IngestExternalException, XMLStreamException { IngestExternalClientFactory.changeMode((SecureClientConfiguration)null); final IngestExternalClient client = IngestExternalClientFactory.getInstance().getClient(); assertNotNull(client); RequestResponse<Void> requestResponse = client.ingestLocal(new VitamContext(TENANT_ID), new LocalFile("path"), CONTEXT_ID, EXECUTION_MODE); assertEquals(requestResponse.getHttpCode(), 202); }
@Override public RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId, String action) throws IngestExternalException { RequestResponseOK r = new RequestResponseOK<>(); r.setHttpCode(Status.ACCEPTED.getStatusCode()); r.addHeader(FAKE_X_REQUEST_ID, X_REQUEST_ID); return r; }
IngestExternalClientMock extends AbstractMockClient implements IngestExternalClient { @Override public RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId, String action) throws IngestExternalException { RequestResponseOK r = new RequestResponseOK<>(); r.setHttpCode(Status.ACCEPTED.getStatusCode()); r.addHeader(FAKE_X_REQUEST_ID, X_REQUEST_ID); return r; } }
IngestExternalClientMock extends AbstractMockClient implements IngestExternalClient { @Override public RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId, String action) throws IngestExternalException { RequestResponseOK r = new RequestResponseOK<>(); r.setHttpCode(Status.ACCEPTED.getStatusCode()); r.addHeader(FAKE_X_REQUEST_ID, X_REQUEST_ID); return r; }  }
IngestExternalClientMock extends AbstractMockClient implements IngestExternalClient { @Override public RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId, String action) throws IngestExternalException { RequestResponseOK r = new RequestResponseOK<>(); r.setHttpCode(Status.ACCEPTED.getStatusCode()); r.addHeader(FAKE_X_REQUEST_ID, X_REQUEST_ID); return r; }  @Override RequestResponse<Void> ingest(VitamContext vitamContext, InputStream stream,
        String contextId,
        String action); @Override RequestResponse<Void> ingest(VitamContext vitamContext, InputStream stream,
        IngestRequestParameters ingestRequestParameters); @Override Response downloadObjectAsync(VitamContext vitamContext, String objectId,
        IngestCollection type); @Override RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId,
        String action); @Override RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile,
        IngestRequestParameters ingestRequestParameters); }
IngestExternalClientMock extends AbstractMockClient implements IngestExternalClient { @Override public RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId, String action) throws IngestExternalException { RequestResponseOK r = new RequestResponseOK<>(); r.setHttpCode(Status.ACCEPTED.getStatusCode()); r.addHeader(FAKE_X_REQUEST_ID, X_REQUEST_ID); return r; }  @Override RequestResponse<Void> ingest(VitamContext vitamContext, InputStream stream,
        String contextId,
        String action); @Override RequestResponse<Void> ingest(VitamContext vitamContext, InputStream stream,
        IngestRequestParameters ingestRequestParameters); @Override Response downloadObjectAsync(VitamContext vitamContext, String objectId,
        IngestCollection type); @Override RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile, String contextId,
        String action); @Override RequestResponse<Void> ingestLocal(VitamContext vitamContext, LocalFile localFile,
        IngestRequestParameters ingestRequestParameters); static final String ID; }