@Test(expected = NullPointerException.class) public void processVideo_NoSettingsProvider_ThrowsNullPointerException() { ServerWrapper server = new ServerWrapper(null, null); server.processVideo(null, null); }
public String processVideo(String videoId, SettingsProvider settingsProvider) { ProcessUrlBuilder urlBuilder = new ProcessUrlBuilder() .withHost(this.Host) .withScheme(this.Scheme) .withVideoId(videoId) .withSoundedSpeed(settingsProvider.getSoundSpeed()) .withSilentSpeed(settingsProvider.getSilenceSpeed()) .withSilentThreshold(settingsProvider.getSilenceThreshold()) .withFrameMargin(settingsProvider.getFrameMargin()); if (settingsProvider.getAdvancedOptionsSwitchEnabled()) { urlBuilder .withSampleRate(settingsProvider.getSampleRate()) .withFrameRate(settingsProvider.getFrameRate()) .withFrameQuality(settingsProvider.getFrameQuality()); } HttpUrl url = urlBuilder.build(); Request request = new Request.Builder() .url(url) .get() .build(); return this.getStringResponseFromServer(request); }
ServerWrapper { public String processVideo(String videoId, SettingsProvider settingsProvider) { ProcessUrlBuilder urlBuilder = new ProcessUrlBuilder() .withHost(this.Host) .withScheme(this.Scheme) .withVideoId(videoId) .withSoundedSpeed(settingsProvider.getSoundSpeed()) .withSilentSpeed(settingsProvider.getSilenceSpeed()) .withSilentThreshold(settingsProvider.getSilenceThreshold()) .withFrameMargin(settingsProvider.getFrameMargin()); if (settingsProvider.getAdvancedOptionsSwitchEnabled()) { urlBuilder .withSampleRate(settingsProvider.getSampleRate()) .withFrameRate(settingsProvider.getFrameRate()) .withFrameQuality(settingsProvider.getFrameQuality()); } HttpUrl url = urlBuilder.build(); Request request = new Request.Builder() .url(url) .get() .build(); return this.getStringResponseFromServer(request); } }
ServerWrapper { public String processVideo(String videoId, SettingsProvider settingsProvider) { ProcessUrlBuilder urlBuilder = new ProcessUrlBuilder() .withHost(this.Host) .withScheme(this.Scheme) .withVideoId(videoId) .withSoundedSpeed(settingsProvider.getSoundSpeed()) .withSilentSpeed(settingsProvider.getSilenceSpeed()) .withSilentThreshold(settingsProvider.getSilenceThreshold()) .withFrameMargin(settingsProvider.getFrameMargin()); if (settingsProvider.getAdvancedOptionsSwitchEnabled()) { urlBuilder .withSampleRate(settingsProvider.getSampleRate()) .withFrameRate(settingsProvider.getFrameRate()) .withFrameQuality(settingsProvider.getFrameQuality()); } HttpUrl url = urlBuilder.build(); Request request = new Request.Builder() .url(url) .get() .build(); return this.getStringResponseFromServer(request); } @Inject  ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper); }
ServerWrapper { public String processVideo(String videoId, SettingsProvider settingsProvider) { ProcessUrlBuilder urlBuilder = new ProcessUrlBuilder() .withHost(this.Host) .withScheme(this.Scheme) .withVideoId(videoId) .withSoundedSpeed(settingsProvider.getSoundSpeed()) .withSilentSpeed(settingsProvider.getSilenceSpeed()) .withSilentThreshold(settingsProvider.getSilenceThreshold()) .withFrameMargin(settingsProvider.getFrameMargin()); if (settingsProvider.getAdvancedOptionsSwitchEnabled()) { urlBuilder .withSampleRate(settingsProvider.getSampleRate()) .withFrameRate(settingsProvider.getFrameRate()) .withFrameQuality(settingsProvider.getFrameQuality()); } HttpUrl url = urlBuilder.build(); Request request = new Request.Builder() .url(url) .get() .build(); return this.getStringResponseFromServer(request); } @Inject  ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper); Boolean ping(); String uploadVideo(File video); String downloadYouTubeVideo(String youtubeUrl); String processVideo(String videoId, SettingsProvider settingsProvider); boolean downloadVideo(String downloadId); }
ServerWrapper { public String processVideo(String videoId, SettingsProvider settingsProvider) { ProcessUrlBuilder urlBuilder = new ProcessUrlBuilder() .withHost(this.Host) .withScheme(this.Scheme) .withVideoId(videoId) .withSoundedSpeed(settingsProvider.getSoundSpeed()) .withSilentSpeed(settingsProvider.getSilenceSpeed()) .withSilentThreshold(settingsProvider.getSilenceThreshold()) .withFrameMargin(settingsProvider.getFrameMargin()); if (settingsProvider.getAdvancedOptionsSwitchEnabled()) { urlBuilder .withSampleRate(settingsProvider.getSampleRate()) .withFrameRate(settingsProvider.getFrameRate()) .withFrameQuality(settingsProvider.getFrameQuality()); } HttpUrl url = urlBuilder.build(); Request request = new Request.Builder() .url(url) .get() .build(); return this.getStringResponseFromServer(request); } @Inject  ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper); Boolean ping(); String uploadVideo(File video); String downloadYouTubeVideo(String youtubeUrl); String processVideo(String videoId, SettingsProvider settingsProvider); boolean downloadVideo(String downloadId); public boolean HasError; }