test_class.file: frontend/app/src/test/java/com/eddex/jackle/jumpcutter/internet/ServerWrapperTest.java
test_class.identifier: ServerWrapperTest
test_case.body: @Test
      public void downloadVideo_DownloadSuccessful_ReturnsTrue() {
  
          final String DownloadId = "download_id";
  
          MockInterceptor okHttpMockInterceptor = new MockInterceptor();
          okHttpMockInterceptor.addRule()
                  .get()
                  .urlStarts("https://jumpcutter.letum.ch/download?download_id=" + DownloadId)
                  .respond("I am video");
          OkHttpClient okHttpClient = new OkHttpClient.Builder()
                  .addInterceptor(okHttpMockInterceptor)
                  .build();
  
          FileSystemWrapper fileSystemWrapperMock = Mockito.mock(FileSystemWrapper.class);
  
          ServerWrapper server = new ServerWrapper(okHttpClient, fileSystemWrapperMock);
          Boolean response = server.downloadVideo(DownloadId);
  
          Assert.assertEquals(true, response);
      }
test_case.class_method_signature: ServerWrapperTest.downloadVideo_DownloadSuccessful_ReturnsTrue()
test_case.full_signature: @Test public void downloadVideo_DownloadSuccessful_ReturnsTrue()
test_case.identifier: downloadVideo_DownloadSuccessful_ReturnsTrue
test_case.invocations: respond urlStarts get addRule build addInterceptor mock downloadVideo assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void downloadVideo_DownloadSuccessful_ReturnsTrue()
focal_class.declarator: HasError = false
focal_class.modifier: public
focal_class.original_string: public boolean HasError = false;
focal_class.type: boolean
focal_class.var_name: HasError
focal_class.declarator: okHttpClient
focal_class.modifier: private final
focal_class.original_string: private final OkHttpClient okHttpClient;
focal_class.type: OkHttpClient
focal_class.var_name: okHttpClient
focal_class.declarator: filesystemWrapper
focal_class.modifier: private final
focal_class.original_string: private final FileSystemWrapper filesystemWrapper;
focal_class.type: FileSystemWrapper
focal_class.var_name: filesystemWrapper
focal_class.declarator: Scheme = "https"
focal_class.modifier: private final
focal_class.original_string: private final String Scheme = "https";
focal_class.type: String
focal_class.var_name: Scheme
focal_class.declarator: Host = "jumpcutter.letum.ch"
focal_class.modifier: private final
focal_class.original_string: private final String Host = "jumpcutter.letum.ch";
focal_class.type: String
focal_class.var_name: Host
focal_class.file: frontend/app/src/main/java/com/eddex/jackle/jumpcutter/internet/ServerWrapper.java
focal_class.identifier: ServerWrapper
focal_class.class_method_signature: ServerWrapper.ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper)
focal_class.full_signature: @Inject public  ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper)
focal_class.identifier: ServerWrapper
focal_class.modifiers: @Inject public
focal_class.parameters: (OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper)
focal_class.signature:  ServerWrapper(OkHttpClient okHttpClient, FileSystemWrapper filesystemWrapper)
focal_class.class_method_signature: ServerWrapper.ping()
focal_class.full_signature: public Boolean ping()
focal_class.identifier: ping
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Boolean
focal_class.signature: Boolean ping()
focal_class.class_method_signature: ServerWrapper.uploadVideo(File video)
focal_class.full_signature: public String uploadVideo(File video)
focal_class.identifier: uploadVideo
focal_class.modifiers: public
focal_class.parameters: (File video)
focal_class.return: String
focal_class.signature: String uploadVideo(File video)
focal_class.class_method_signature: ServerWrapper.downloadYouTubeVideo(String youtubeUrl)
focal_class.full_signature: public String downloadYouTubeVideo(String youtubeUrl)
focal_class.identifier: downloadYouTubeVideo
focal_class.modifiers: public
focal_class.parameters: (String youtubeUrl)
focal_class.return: String
focal_class.signature: String downloadYouTubeVideo(String youtubeUrl)
focal_class.class_method_signature: ServerWrapper.processVideo(String videoId, SettingsProvider settingsProvider)
focal_class.full_signature: public String processVideo(String videoId, SettingsProvider settingsProvider)
focal_class.identifier: processVideo
focal_class.modifiers: public
focal_class.parameters: (String videoId, SettingsProvider settingsProvider)
focal_class.return: String
focal_class.signature: String processVideo(String videoId, SettingsProvider settingsProvider)
focal_class.class_method_signature: ServerWrapper.downloadVideo(String downloadId)
focal_class.full_signature: public boolean downloadVideo(String downloadId)
focal_class.identifier: downloadVideo
focal_class.modifiers: public
focal_class.parameters: (String downloadId)
focal_class.return: boolean
focal_class.signature: boolean downloadVideo(String downloadId)
focal_class.class_method_signature: ServerWrapper.getStringResponseFromServer(Request request)
focal_class.full_signature: private String getStringResponseFromServer(Request request)
focal_class.identifier: getStringResponseFromServer
focal_class.modifiers: private
focal_class.parameters: (Request request)
focal_class.return: String
focal_class.signature: String getStringResponseFromServer(Request request)
focal_method.body: public boolean downloadVideo(String downloadId) {
  
          boolean successful = true;
  
          HttpUrl url = new HttpUrl.Builder()
                  .scheme(this.Scheme)
                  .host(this.Host)
                  //.port(this.Port)
                  .addPathSegment("download")
                  .addQueryParameter("download_id", downloadId)
                  .build();
  
          Request request = new Request.Builder()
                  .url(url)
                  .get()
                  .build();
  
          try {
              // get video
              Response response = this.okHttpClient.newCall(request).execute();
              byte[] video = response.body().bytes();
              this.filesystemWrapper.saveDownloadedVideo(video);
  
          } catch (IOException e) {
              e.printStackTrace();
              successful = false;
          }
          catch (IllegalStateException e) {
              e.printStackTrace();
              successful = false;
          }
          return successful;
      }
focal_method.class_method_signature: ServerWrapper.downloadVideo(String downloadId)
focal_method.full_signature: public boolean downloadVideo(String downloadId)
focal_method.identifier: downloadVideo
focal_method.invocations: build addQueryParameter addPathSegment host scheme build get url execute newCall bytes body saveDownloadedVideo printStackTrace printStackTrace
focal_method.modifiers: public
focal_method.parameters: (String downloadId)
focal_method.return: boolean
focal_method.signature: boolean downloadVideo(String downloadId)