NIFI-9420 Upgraded MiNiFi Guava from 26.0 to 31.0.1

- Replaced usage of Guava Lists with standard Java classes in TemplatesIteratorTest

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #5556
This commit is contained in:
exceptionfactory 2021-11-29 11:51:47 -06:00 committed by Matthew Burgess
parent 07c4a05cdf
commit 55e91d607c
No known key found for this signature in database
GPG Key ID: 05D3DEB8126DAD24
2 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,6 @@
package org.apache.nifi.minifi.c2.provider.nifi.rest;
import com.fasterxml.jackson.core.JsonFactory;
import com.google.common.collect.Lists;
import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
import org.apache.nifi.minifi.c2.api.util.Pair;
import org.apache.nifi.minifi.c2.provider.util.HttpConnector;
@ -27,6 +26,7 @@ import org.junit.Test;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
@ -64,9 +64,9 @@ public class TemplatesIteratorTest {
@Test
public void testIteratorNoTemplates() throws ConfigurationProviderException, IOException {
when(httpURLConnection.getInputStream()).thenReturn(TemplatesIteratorTest.class.getClassLoader().getResourceAsStream("noTemplates.json"));
List<Pair<String, String>> idToNameList;
List<Pair<String, String>> idToNameList = new ArrayList<>();
try (TemplatesIterator templatesIterator = new TemplatesIterator(httpConnector, jsonFactory)) {
idToNameList = Lists.newArrayList(templatesIterator);
templatesIterator.forEachRemaining(idToNameList::add);
}
assertEquals(0, idToNameList.size());
@ -76,9 +76,9 @@ public class TemplatesIteratorTest {
@Test
public void testIteratorSingleTemplate() throws ConfigurationProviderException, IOException {
when(httpURLConnection.getInputStream()).thenReturn(TemplatesIteratorTest.class.getClassLoader().getResourceAsStream("oneTemplate.json"));
List<Pair<String, String>> idToNameList;
List<Pair<String, String>> idToNameList = new ArrayList<>();
try (TemplatesIterator templatesIterator = new TemplatesIterator(httpConnector, jsonFactory)) {
idToNameList = Lists.newArrayList(templatesIterator);
templatesIterator.forEachRemaining(idToNameList::add);
}
assertEquals(1, idToNameList.size());
Pair<String, String> idNamePair = idToNameList.get(0);
@ -91,9 +91,9 @@ public class TemplatesIteratorTest {
@Test
public void testIteratorTwoTemplates() throws ConfigurationProviderException, IOException {
when(httpURLConnection.getInputStream()).thenReturn(TemplatesIteratorTest.class.getClassLoader().getResourceAsStream("twoTemplates.json"));
List<Pair<String, String>> idToNameList;
List<Pair<String, String>> idToNameList = new ArrayList<>();
try (TemplatesIterator templatesIterator = new TemplatesIterator(httpConnector, jsonFactory)) {
idToNameList = Lists.newArrayList(templatesIterator);
templatesIterator.forEachRemaining(idToNameList::add);
}
assertEquals(2, idToNameList.size());
Pair<String, String> idNamePair = idToNameList.get(0);

View File

@ -933,7 +933,7 @@ limitations under the License.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
<version>31.0.1-jre</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>