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(); }