From 2c9ee21f2cf8fc230decfc48e3f652fe11862216 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 9 Nov 2022 12:41:32 +0000 Subject: Reduce the number of raw-type related warnings in aai-common Issue-ID: AAI-3586 Signed-off-by: Fiete Ostkamp Change-Id: If4affb02cfe40b4b82ecbdbb1a25d919d88be25c --- .../aai/prevalidation/ValidationServiceTest.java | 2 +- .../java/org/onap/aai/restcore/RESTAPITest.java | 8 +++++-- .../aai/serialization/db/DbSerializerTest.java | 26 ++++++++++++++++++---- .../queryformats/ResourceFormatTest.java | 6 +++-- .../queryformats/SimpleFormatTest.java | 2 +- 5 files changed, 34 insertions(+), 10 deletions(-) (limited to 'aai-core/src/test/java') diff --git a/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java b/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java index 7f6e5610..d017408f 100644 --- a/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java +++ b/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java @@ -115,7 +115,7 @@ public class ValidationServiceTest { String validationResponse = PayloadUtil.getResourcePayload("prevalidation/success-response-with-empty-violations.json"); - ResponseEntity responseEntity = Mockito.mock(ResponseEntity.class, Mockito.RETURNS_DEEP_STUBS); + ResponseEntity responseEntity = Mockito.mock(ResponseEntity.class, Mockito.RETURNS_DEEP_STUBS); Mockito.when(restClient.execute(eq(ValidationService.VALIDATION_ENDPOINT), eq(HttpMethod.POST), any(), eq(pserverRequest))).thenReturn(responseEntity); diff --git a/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java b/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java index 3c099c75..4b73a7d7 100644 --- a/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java +++ b/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java @@ -27,7 +27,11 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; -import javax.ws.rs.core.*; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; import org.junit.Assert; import org.junit.BeforeClass; @@ -38,7 +42,7 @@ import org.onap.aai.exceptions.AAIException; public class RESTAPITest extends AAISetup { private static RESTAPI restapi; private static HttpHeaders httpHeaders; - private static Callable callable; + private static Callable callable; private static UriInfo info; private static Response response; diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java index 282f6457..f921a77c 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java @@ -21,14 +21,27 @@ package org.onap.aai.serialization.db; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -37,7 +50,12 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.janusgraph.core.JanusGraphFactory; -import org.junit.*; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -987,7 +1005,7 @@ public class DbSerializerTest extends AAISetup { @Test public void cascadeL3NetworkPreventDeleteTest() throws AAIException, UnsupportedEncodingException { l3NetworkSetup(); - ArrayList expected_messages = new ArrayList(); + ArrayList expected_messages = new ArrayList<>(); expected_messages.add( "Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv4-address-list, l3-interface-ipv6-address-list]"); expected_messages.add( diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java index 10178931..e26c56e2 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java @@ -20,7 +20,9 @@ package org.onap.aai.serialization.queryformats; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -130,7 +132,7 @@ public class ResourceFormatTest extends AAISetup { FormatFactory ff = new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/"); - MultivaluedMap mvm = new MultivaluedHashMap(); + MultivaluedMap mvm = new MultivaluedHashMap<>(); mvm.add("depth", "0"); Formatter formatter = ff.get(Format.resource, mvm); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java index 279c3e83..d09c2e1e 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java @@ -142,7 +142,7 @@ public class SimpleFormatTest extends AAISetup { FormatFactory ff = new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/"); - MultivaluedMap mvm = new MultivaluedHashMap(); + MultivaluedMap mvm = new MultivaluedHashMap<>(); mvm.add("depth", "0"); Formatter formatter = ff.get(Format.simple, mvm); -- cgit 1.2.3-korg