From a35cd6c4cd48a94a4fea557de7a709da395cae4f Mon Sep 17 00:00:00 2001 From: thcai Date: Thu, 1 Aug 2024 09:54:58 +0200 Subject: [PATCH] getFirst() --- .../ns4kafka/controller/ConnectorControllerTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/michelin/ns4kafka/controller/ConnectorControllerTest.java b/src/test/java/com/michelin/ns4kafka/controller/ConnectorControllerTest.java index b1f2e21a..ce0e8c72 100644 --- a/src/test/java/com/michelin/ns4kafka/controller/ConnectorControllerTest.java +++ b/src/test/java/com/michelin/ns4kafka/controller/ConnectorControllerTest.java @@ -168,7 +168,7 @@ void deleteConnectorNotOwned() { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); assertEquals("Invalid value \"connect1\" for field \"name\": namespace is not owner of the resource.", - ((ResourceValidationException) error).getValidationErrors().get(0)); + ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); } @@ -267,7 +267,7 @@ void createConnectorNotOwner() { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); assertEquals("Invalid value \"connect1\" for field \"name\": namespace is not owner of the resource.", - ((ResourceValidationException) error).getValidationErrors().get(0)); + ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); } @@ -297,7 +297,7 @@ void createConnectorLocalErrors() { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); assertEquals("Local Validation Error 1", - ((ResourceValidationException) error).getValidationErrors().get(0)); + ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); } @@ -330,7 +330,7 @@ void createConnectorRemoteErrors() { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); assertEquals("Remote Validation Error 1", - ((ResourceValidationException) error).getValidationErrors().get(0)); + ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); } @@ -400,7 +400,7 @@ void createConnectorFailQuotaValidation() { .consumeErrorWith(error -> { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); - assertEquals("Quota error", ((ResourceValidationException) error).getValidationErrors().get(0)); + assertEquals("Quota error", ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); } @@ -600,7 +600,7 @@ void restartConnectorNotOwned() { assertEquals(ResourceValidationException.class, error.getClass()); assertEquals(1, ((ResourceValidationException) error).getValidationErrors().size()); assertEquals("Invalid value \"connect1\" for field \"name\": namespace is not owner of the resource.", - ((ResourceValidationException) error).getValidationErrors().get(0)); + ((ResourceValidationException) error).getValidationErrors().getFirst()); }) .verify(); }