refactor(gateway-engine) Get rid of various Java type warnings.
MODIFY
gateway/engine/core/src/main/java/io/apiman/gateway/engine/io/JsonPayloadIO.java
gateway/engine/core/src/main/java/io/apiman/gateway/engine/io/JsonPayloadIO.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
*
* @author eric.wittmann@redhat.com
*/
+@SuppressWarnings("rawtypes")
public class JsonPayloadIO implements IPayloadIO<Map> {
private static final ObjectMapper mapper = new ObjectMapper();

MODIFY
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/AesDataEncrypterTest.java
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/AesDataEncrypterTest.java
@@ -38,7 +38,7 @@ public class AesDataEncrypterTest {
@Test
public void dataEncrypterWithKey() {
- Map<String, String> config = new HashMap();
+ Map<String, String> config = new HashMap<>();
config.put("secretKey", "a2a0aa80-84Zd2a6");
IDataEncrypter dataEncrypter = new AesDataEncrypter(config);
@@ -52,7 +52,7 @@ public class AesDataEncrypterTest {
@Test
public void dataEncrypterWithDifferentKey() {
- Map<String, String> config = new HashMap();
+ Map<String, String> config = new HashMap<>();
config.put("secretKey", "H2a9a780-m4Zd2a0");
IDataEncrypter dataEncrypter = new AesDataEncrypter(config);
@@ -68,7 +68,7 @@ public class AesDataEncrypterTest {
@Test(expected = RuntimeException.class)
public void dataEncrypterWithoutKey() {
- Map<String, String> config = new HashMap();
+ Map<String, String> config = new HashMap<>();
IDataEncrypter dataEncrypter = new AesDataEncrypter(config);
dataEncrypter.encrypt("Hello, world.", encryptionCtx);

MODIFY
gateway/engine/core/src/test/java/io/apiman/gateway/engine/io/JsonPayloadIOTest.java
gateway/engine/core/src/test/java/io/apiman/gateway/engine/io/JsonPayloadIOTest.java
@@ -31,7 +31,7 @@ import org.junit.Test;
*
* @author eric.wittmann@redhat.com
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "rawtypes"})
public class JsonPayloadIOTest {
@Test
@@ -131,7 +131,7 @@ public class JsonPayloadIOTest {
@Test
public void testMarshall_Simple() throws Exception {
- Map data = new LinkedHashMap();
+ Map<String, Comparable> data = new LinkedHashMap<>();
data.put("hello", "world");
data.put("foo", "bar");
data.put("bool", true);
@@ -144,6 +144,7 @@ public class JsonPayloadIOTest {
Assert.assertEquals(expected, actual);
}
+ @SuppressWarnings("unchecked")
private List toList(Object ... items) {
List rval = new ArrayList();
for (Object item : items) {

MODIFY
gateway/engine/core/src/test/java/io/apiman/gateway/engine/io/SoapPayloadIOTest.java
gateway/engine/core/src/test/java/io/apiman/gateway/engine/io/SoapPayloadIOTest.java
@@ -65,7 +65,7 @@ public class SoapPayloadIOTest {
SOAPHeader header = envelope.getHeader();
Assert.assertNotNull(header);
- Iterator allHeaderElements = header.examineAllHeaderElements();
+ Iterator<?> allHeaderElements = header.examineAllHeaderElements();
Assert.assertTrue(allHeaderElements.hasNext());
SOAPHeaderElement cheader = (SOAPHeaderElement) allHeaderElements.next();
Assert.assertNotNull(cheader);

refactor(gateway-engine) Get rid of various Java type warnings.