@Test public void testInvalidJson() throws IOException { when(_mockPropertiesUtil.getHttpStorageUploadRetryCount()) .thenReturn(0); when(_mockPropertiesUtil.getNginxStorageUploadThreadCount()) .thenReturn(1); try { JsonOutputObject outputObject = mock(JsonOutputObject.class); when(outputObject.getJobId()) .thenReturn(TEST_JOB_ID); _nginxStorageService.store(outputObject); fail("Expected exception not thrown."); } catch (StorageException e) { assertTrue(e.getCause() instanceof JsonProcessingException); } }
@Override public URI store(JsonOutputObject outputObject) throws StorageException { URI serviceUri = getServiceUri(outputObject.getJobId()); try (PipeStream inputStream = createJsonInputStream(outputObject)) { return store(serviceUri, inputStream); } }
CustomNginxStorageBackend implements StorageBackend { @Override public URI store(JsonOutputObject outputObject) throws StorageException { URI serviceUri = getServiceUri(outputObject.getJobId()); try (PipeStream inputStream = createJsonInputStream(outputObject)) { return store(serviceUri, inputStream); } } }
CustomNginxStorageBackend implements StorageBackend { @Override public URI store(JsonOutputObject outputObject) throws StorageException { URI serviceUri = getServiceUri(outputObject.getJobId()); try (PipeStream inputStream = createJsonInputStream(outputObject)) { return store(serviceUri, inputStream); } } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); }
CustomNginxStorageBackend implements StorageBackend { @Override public URI store(JsonOutputObject outputObject) throws StorageException { URI serviceUri = getServiceUri(outputObject.getJobId()); try (PipeStream inputStream = createJsonInputStream(outputObject)) { return store(serviceUri, inputStream); } } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); @Override boolean canStore(JsonOutputObject outputObject); @Override URI store(JsonOutputObject outputObject); @Override boolean canStore(MarkupResult markupResult); @Override void store(MarkupResult markupResult); @Override boolean canStore(ArtifactExtractionRequest request); @Override Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request); URI store(URI serviceUri, InputStream content); }
CustomNginxStorageBackend implements StorageBackend { @Override public URI store(JsonOutputObject outputObject) throws StorageException { URI serviceUri = getServiceUri(outputObject.getJobId()); try (PipeStream inputStream = createJsonInputStream(outputObject)) { return store(serviceUri, inputStream); } } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); @Override boolean canStore(JsonOutputObject outputObject); @Override URI store(JsonOutputObject outputObject); @Override boolean canStore(MarkupResult markupResult); @Override void store(MarkupResult markupResult); @Override boolean canStore(ArtifactExtractionRequest request); @Override Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request); URI store(URI serviceUri, InputStream content);  }