@Test
public void testUploadHelper() {

    AtomicInteger uploadCount = new AtomicInteger(0);
    String path = "some/test/path.json";
    ExternalStorageLocation location = new ExternalStorageLocation();
    location.setPath(path);
    when(externalPayloadStorage.getLocation(any(), any(), any())).thenReturn(location);
    doAnswer(invocation -> {
        uploadCount.incrementAndGet();
        return null;
    }).when(externalPayloadStorage).upload(anyString(), any(), anyLong());
    assertEquals(path, externalPayloadStorageUtils.uploadHelper(new byte[]{}, 10L, ExternalPayloadStorage.PayloadType.TASK_OUTPUT));
    assertEquals(1, uploadCount.get());
}