From 1bb4f8615103c3702236bab98263c6f31233ca21 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Tue, 16 Jan 2018 14:22:20 -0500 Subject: [PATCH] Minor Fixes - use passive mode for FTP tests (active fails on one of my machines for some reason) * Fix generic args instead of `@SuppressWarnings("rawtypes")` --- .../integration/json/JsonPropertyAccessor.java | 14 ++++++++------ .../integration/ftp/FtpTestSupport.java | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java index b612005409..7d50bc88a7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java @@ -40,6 +40,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; * @author Eric Bottard * @author Artem Bilan * @author Paul Martin + * @author Gary Russell * * @since 3.0 */ @@ -164,7 +165,7 @@ public class JsonPropertyAccessor implements PropertyAccessor { } } - public static WrappedJsonNode wrap(JsonNode json) { + public static WrappedJsonNode wrap(JsonNode json) { if (json == null) { return null; } @@ -243,7 +244,8 @@ public class JsonPropertyAccessor implements PropertyAccessor { * An {@link AbstractList} implementation around {@link ArrayNode} with {@link WrappedJsonNode} aspect. * @since 5.0 */ - public static class ArrayNodeAsList extends AbstractList implements WrappedJsonNode { + public static class ArrayNodeAsList extends AbstractList> + implements WrappedJsonNode { private final ArrayNode node; @@ -257,7 +259,7 @@ public class JsonPropertyAccessor implements PropertyAccessor { } @Override - public WrappedJsonNode get(int index) { + public WrappedJsonNode get(int index) { return wrap(this.node.get(index)); } @@ -267,9 +269,9 @@ public class JsonPropertyAccessor implements PropertyAccessor { } @Override - public Iterator iterator() { + public Iterator> iterator() { - return new Iterator() { + return new Iterator>() { private final Iterator delegate = ArrayNodeAsList.this.node.iterator(); @@ -279,7 +281,7 @@ public class JsonPropertyAccessor implements PropertyAccessor { } @Override - public WrappedJsonNode next() { + public WrappedJsonNode next() { return wrap(this.delegate.next()); } diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java index ff2ba273aa..5030e70eea 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.springframework.integration.ftp; import java.util.Arrays; +import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.ftpserver.FtpServer; import org.apache.ftpserver.FtpServerFactory; @@ -85,6 +86,7 @@ public class FtpTestSupport extends RemoteFileTestSupport { sf.setPort(port); sf.setUsername("foo"); sf.setPassword("foo"); + sf.setClientMode(FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE); return new CachingSessionFactory(sf); }