@Test void testUploadInvalidParametersShouldThrowException() throws Exception { final IllegalArgumentException result = assertThrows(IllegalArgumentException.class, () -> PodUpload.upload(mockClient, mockContext, operationSupport, mockPathToUpload)); assertThat(result.getMessage(), equalTo("Provided arguments are not valid (file, directory, path)")); }
public static boolean upload(OkHttpClient client, PodOperationContext context, OperationSupport operationSupport, Path pathToUpload) throws IOException, InterruptedException { if (Utils.isNotNullOrEmpty(context.getFile()) && pathToUpload.toFile().isFile()) { return uploadFile(client, context, operationSupport, pathToUpload); } else if (Utils.isNotNullOrEmpty(context.getDir()) && pathToUpload.toFile().isDirectory()) { return uploadDirectory(client, context, operationSupport, pathToUpload); } throw new IllegalArgumentException("Provided arguments are not valid (file, directory, path)"); }
PodUpload { public static boolean upload(OkHttpClient client, PodOperationContext context, OperationSupport operationSupport, Path pathToUpload) throws IOException, InterruptedException { if (Utils.isNotNullOrEmpty(context.getFile()) && pathToUpload.toFile().isFile()) { return uploadFile(client, context, operationSupport, pathToUpload); } else if (Utils.isNotNullOrEmpty(context.getDir()) && pathToUpload.toFile().isDirectory()) { return uploadDirectory(client, context, operationSupport, pathToUpload); } throw new IllegalArgumentException("Provided arguments are not valid (file, directory, path)"); } }
PodUpload { public static boolean upload(OkHttpClient client, PodOperationContext context, OperationSupport operationSupport, Path pathToUpload) throws IOException, InterruptedException { if (Utils.isNotNullOrEmpty(context.getFile()) && pathToUpload.toFile().isFile()) { return uploadFile(client, context, operationSupport, pathToUpload); } else if (Utils.isNotNullOrEmpty(context.getDir()) && pathToUpload.toFile().isDirectory()) { return uploadDirectory(client, context, operationSupport, pathToUpload); } throw new IllegalArgumentException("Provided arguments are not valid (file, directory, path)"); } private  PodUpload(); }
PodUpload { public static boolean upload(OkHttpClient client, PodOperationContext context, OperationSupport operationSupport, Path pathToUpload) throws IOException, InterruptedException { if (Utils.isNotNullOrEmpty(context.getFile()) && pathToUpload.toFile().isFile()) { return uploadFile(client, context, operationSupport, pathToUpload); } else if (Utils.isNotNullOrEmpty(context.getDir()) && pathToUpload.toFile().isDirectory()) { return uploadDirectory(client, context, operationSupport, pathToUpload); } throw new IllegalArgumentException("Provided arguments are not valid (file, directory, path)"); } private  PodUpload(); static boolean upload(OkHttpClient client, PodOperationContext context,
    OperationSupport operationSupport, Path pathToUpload); }
PodUpload { public static boolean upload(OkHttpClient client, PodOperationContext context, OperationSupport operationSupport, Path pathToUpload) throws IOException, InterruptedException { if (Utils.isNotNullOrEmpty(context.getFile()) && pathToUpload.toFile().isFile()) { return uploadFile(client, context, operationSupport, pathToUpload); } else if (Utils.isNotNullOrEmpty(context.getDir()) && pathToUpload.toFile().isDirectory()) { return uploadDirectory(client, context, operationSupport, pathToUpload); } throw new IllegalArgumentException("Provided arguments are not valid (file, directory, path)"); } private  PodUpload(); static boolean upload(OkHttpClient client, PodOperationContext context,
    OperationSupport operationSupport, Path pathToUpload);  }