diff --git a/src/main/java/com/transloadit/sdk/Assembly.java b/src/main/java/com/transloadit/sdk/Assembly.java index 6807761..18edd47 100644 --- a/src/main/java/com/transloadit/sdk/Assembly.java +++ b/src/main/java/com/transloadit/sdk/Assembly.java @@ -566,7 +566,8 @@ private void listenToServerSentEvents(AssemblyResponse response) throws LocalOpe final URI sseUpdateStreamUrl = URI.create(response.getUpdateStreamUrl()); final ConnectStrategy connectStrategy = ConnectStrategy.http(sseUpdateStreamUrl).connectTimeout(10, TimeUnit.MINUTES); final ErrorStrategy errorStrategy = ErrorStrategy.alwaysContinue(); - final EventsourceRunnable eventsourceRunnable = new EventsourceRunnable(transloadit, response, assemblyListener, connectStrategy, errorStrategy); + final EventsourceRunnable eventsourceRunnable = + new EventsourceRunnable(transloadit, response, assemblyListener, connectStrategy, errorStrategy); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(eventsourceRunnable); diff --git a/src/test/java/com/transloadit/sdk/AssemblyTest.java b/src/test/java/com/transloadit/sdk/AssemblyTest.java index 0dafdb2..3f235fc 100644 --- a/src/test/java/com/transloadit/sdk/AssemblyTest.java +++ b/src/test/java/com/transloadit/sdk/AssemblyTest.java @@ -6,7 +6,6 @@ import org.jetbrains.annotations.NotNull; import org.json.JSONObject; -import org.json.JSONStringer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -18,7 +17,11 @@ import org.mockserver.model.HttpRequest; import org.mockserver.model.HttpResponse; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.nio.file.Files; import java.util.HashMap; import java.util.Objects; @@ -43,9 +46,9 @@ public class AssemblyTest extends MockHttpService { private Assembly assembly; /** - * Keeps track of events fired by the {@link AssemblyListener} + * Keeps track of events fired by the {@link AssemblyListener}. */ - private HashMap emittedEvents = new HashMap() {{ + private final HashMap emittedEvents = new HashMap() {{ put("ASSEMBLY_ERROR", false); put("ASSEMBLY_META_DATA_EXTRACTED", false); put("ASSEMBLY_INSTRUCTION_UPLOAD_FINISHED", false); diff --git a/src/test/java/com/transloadit/sdk/MockTusAssembly.java b/src/test/java/com/transloadit/sdk/MockTusAssembly.java index e0fe0b8..a399560 100644 --- a/src/test/java/com/transloadit/sdk/MockTusAssembly.java +++ b/src/test/java/com/transloadit/sdk/MockTusAssembly.java @@ -1,7 +1,5 @@ package com.transloadit.sdk; -import io.socket.client.Socket; - import java.io.File; import java.io.IOException; import java.io.InputStream;