diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:30:35 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:39:04 +0200 |
commit | 76a89b62274060452022ddf24a7685ee2f380cb4 (patch) | |
tree | ef924603de22efd026f519ab31fd8f5a6ff60f2f /jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java | |
parent | 7e7ebf7b527be1f163d497a41898e2252d878fe7 (diff) |
Replace all usages of Arrays.asList with List.of where possible.
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java')
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java index 84bdc07dd33..32481b4607e 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java @@ -8,7 +8,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -46,7 +45,7 @@ public class ResponseDispatchTestCase { ReadableContentChannel content = new ReadableContentChannel(); FutureResponse handler = new FutureResponse(content); ByteBuffer buf = ByteBuffer.allocate(69); - ResponseDispatch.newInstance(69, Arrays.asList(buf)).dispatch(handler); + ResponseDispatch.newInstance(69, List.of(buf)).dispatch(handler); Response response = handler.get(600, TimeUnit.SECONDS); assertNotNull(response); assertEquals(69, response.getStatus()); @@ -57,7 +56,7 @@ public class ResponseDispatchTestCase { ReadableContentChannel content = new ReadableContentChannel(); FutureResponse handler = new FutureResponse(content); ByteBuffer buf = ByteBuffer.allocate(69); - ResponseDispatch.newInstance(69, Arrays.asList(buf)).dispatch(handler); + ResponseDispatch.newInstance(69, List.of(buf)).dispatch(handler); Response response = handler.get(600, TimeUnit.SECONDS); assertNotNull(response); assertEquals(69, response.getStatus()); @@ -69,7 +68,7 @@ public class ResponseDispatchTestCase { FutureResponse handler = new FutureResponse(content); ByteBuffer buf = ByteBuffer.allocate(69); Response sentResponse = new Response(69); - ResponseDispatch.newInstance(sentResponse, Arrays.asList(buf)).dispatch(handler); + ResponseDispatch.newInstance(sentResponse, List.of(buf)).dispatch(handler); Response receivedResponse = handler.get(600, TimeUnit.SECONDS); assertSame(sentResponse, receivedResponse); assertSame(buf, content.read()); @@ -80,7 +79,7 @@ public class ResponseDispatchTestCase { @Test void requireThatResponseCanBeDispatched() throws Exception { final Response response = new Response(Response.Status.OK); - final List<ByteBuffer> writtenContent = Arrays.asList(ByteBuffer.allocate(6), ByteBuffer.allocate(9)); + final List<ByteBuffer> writtenContent = List.of(ByteBuffer.allocate(6), ByteBuffer.allocate(9)); ResponseDispatch dispatch = new ResponseDispatch() { @Override |