From 37683f1b8033e9af05040100051ac3ad520ad969 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Sun, 5 Mar 2017 22:19:01 -0500 Subject: [PATCH] INT-4219: Test Polishing JIRA: https://jira.spring.io/browse/INT-4219 - Use `AdditionalAnswers.returnFirstArgument` instead of lambda to return first arg - Enable CheckStyle `AvoidStaticImport` for tests - Fix static import violations in tests --- .../MethodInvokingMessageProcessorTests.java | 3 ++- .../LockRegistryLeaderInitiatorTests.java | 8 +++--- .../ftp/outbound/FtpServerOutboundTests.java | 18 ++++++------- .../HttpInboundChannelAdapterParserTests.java | 4 +-- .../RedisQueueMessageDrivenEndpointTests.java | 6 +++-- .../outbound/SftpServerOutboundTests.java | 18 ++++++------- .../client/StompServerIntegrationTests.java | 2 +- ...annelAdapterWebSocketIntegrationTests.java | 4 +-- ...ssageHandlerWebSocketIntegrationTests.java | 4 +-- .../integration/xml/xpath/XPathTests.java | 27 ++++++++++--------- .../ChatMessageListeningEndpointTests.java | 6 ++--- src/checkstyle/checkstyle-suppressions.xml | 1 - src/checkstyle/checkstyle.xml | 21 ++++++++++++--- 13 files changed, 70 insertions(+), 52 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java index bcc0e62d84..6929a0559d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java @@ -25,6 +25,7 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.AdditionalAnswers.returnsFirstArg; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.willAnswer; import static org.mockito.Mockito.mock; @@ -843,7 +844,7 @@ public class MethodInvokingMessageProcessorTests { helper = new MessagingMethodInvokerHelper<>(bean, UseSpelInvokerBean.class.getDeclaredMethod("buz", String.class), false); ConfigurableListableBeanFactory bf = mock(ConfigurableListableBeanFactory.class); - willAnswer(i -> i.getArgument(0)).given(bf).resolveEmbeddedValue(anyString()); + willAnswer(returnsFirstArg()).given(bf).resolveEmbeddedValue(anyString()); helper.setBeanFactory(bf); try { helper.process(message); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java index 7e93bed33d..1849dfeacd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java @@ -45,9 +45,9 @@ public class LockRegistryLeaderInitiatorTests { private CountDownLatch revoked; - private LockRegistry registry = new DefaultLockRegistry(); + private final LockRegistry registry = new DefaultLockRegistry(); - private LockRegistryLeaderInitiator initiator = + private final LockRegistryLeaderInitiator initiator = new LockRegistryLeaderInitiator(this.registry, new DefaultCandidate()); @Before @@ -90,10 +90,10 @@ public class LockRegistryLeaderInitiatorTests { CountDownLatch other = new CountDownLatch(1); another.setLeaderEventPublisher(new CountingPublisher(other)); this.initiator.start(); - assertThat(this.granted.await(10, TimeUnit.SECONDS), is(true)); + assertThat(this.granted.await(20, TimeUnit.SECONDS), is(true)); another.start(); this.initiator.stop(); - assertThat(other.await(10, TimeUnit.SECONDS), is(true)); + assertThat(other.await(20, TimeUnit.SECONDS), is(true)); assertThat(another.getContext().isLeader(), is(true)); } diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpServerOutboundTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpServerOutboundTests.java index 9eb1b7c972..2d6a887f51 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpServerOutboundTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpServerOutboundTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.ftp.outbound; -import static java.util.regex.Matcher.quoteReplacement; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; @@ -48,6 +47,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.regex.Matcher; import org.apache.commons.io.FileUtils; import org.apache.commons.net.ftp.FTPClient; @@ -165,7 +165,7 @@ public class FtpServerOutboundTests extends FtpTestSupport { Message result = this.output.receive(1000); assertNotNull(result); File localFile = (File) result.getPayload(); - assertThat(localFile.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFile.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir.toUpperCase())); assertPreserved(modified, localFile); @@ -174,7 +174,7 @@ public class FtpServerOutboundTests extends FtpTestSupport { result = this.output.receive(1000); assertNotNull(result); localFile = (File) result.getPayload(); - assertThat(localFile.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFile.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir.toUpperCase())); } @@ -207,7 +207,7 @@ public class FtpServerOutboundTests extends FtpTestSupport { boolean assertedModified = false; for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), containsString(dir)); + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); if (file.getPath().contains("localTarget1")) { assertedModified = assertPreserved(modified, file); } @@ -223,7 +223,7 @@ public class FtpServerOutboundTests extends FtpTestSupport { assertThat(localFiles.size(), Matchers.greaterThan(0)); for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), containsString(dir)); + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); } } @@ -262,14 +262,14 @@ public class FtpServerOutboundTests extends FtpTestSupport { boolean assertedModified = false; for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); if (file.getPath().contains("localTarget1")) { assertedModified = assertPreserved(modified, file); } } assertTrue(assertedModified); - assertThat(localFiles.get(2).getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFiles.get(2).getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir + "subFtpSource")); File secondTarget = new File(getTargetLocalDirectory() + File.separator + "ftpSource", "localTarget2.txt"); @@ -325,10 +325,10 @@ public class FtpServerOutboundTests extends FtpTestSupport { assertEquals(2, localFiles.size()); for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); } - assertThat(localFiles.get(1).getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFiles.get(1).getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir + "subFtpSource")); } diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java index 9a924c31ff..b7bd90da3f 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -17,12 +17,12 @@ package org.springframework.integration.http.config; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java index 910d2787aa..33070e30ec 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java @@ -21,7 +21,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.mockito.internal.verification.VerificationModeFactory.atLeastOnce; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.verify; import java.util.ArrayList; import java.util.Arrays; @@ -268,7 +270,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests { assertTrue(stopLatch.await(10, TimeUnit.SECONDS)); - Mockito.verify(boundListOperations, atLeastOnce()).rightPush(Mockito.any(byte[].class)); + verify(boundListOperations, atLeastOnce()).rightPush(any(byte[].class)); } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java index 691ee21523..bdfb5236ce 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.sftp.outbound; -import static java.util.regex.Matcher.quoteReplacement; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -40,6 +39,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; import org.apache.commons.io.FileUtils; import org.hamcrest.Matchers; @@ -141,7 +141,7 @@ public class SftpServerOutboundTests extends SftpTestSupport { Message result = this.output.receive(1000); assertNotNull(result); File localFile = (File) result.getPayload(); - assertThat(localFile.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFile.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir.toUpperCase())); assertPreserved(modified, localFile); @@ -150,7 +150,7 @@ public class SftpServerOutboundTests extends SftpTestSupport { result = this.output.receive(1000); assertNotNull(result); localFile = (File) result.getPayload(); - assertThat(localFile.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFile.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir.toUpperCase())); Session session2 = this.sessionFactory.getSession(); assertSame(TestUtils.getPropertyValue(session, "targetSession.jschSession"), @@ -186,7 +186,7 @@ public class SftpServerOutboundTests extends SftpTestSupport { boolean assertedModified = false; for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); if (file.getPath().contains("localTarget1")) { assertedModified = assertPreserved(modified, file); @@ -203,7 +203,7 @@ public class SftpServerOutboundTests extends SftpTestSupport { assertThat(localFiles.size(), Matchers.greaterThan(0)); for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); } } @@ -223,14 +223,14 @@ public class SftpServerOutboundTests extends SftpTestSupport { boolean assertedModified = false; for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); if (file.getPath().contains("localTarget1")) { assertedModified = assertPreserved(modified, file); } } assertTrue(assertedModified); - assertThat(localFiles.get(2).getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFiles.get(2).getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir + "subSftpSource")); File secondTarget = new File(getTargetLocalDirectory() + File.separator + "sftpSource", "localTarget2.txt"); @@ -285,10 +285,10 @@ public class SftpServerOutboundTests extends SftpTestSupport { assertEquals(2, localFiles.size()); for (File file : localFiles) { - assertThat(file.getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir)); } - assertThat(localFiles.get(1).getPath().replaceAll(quoteReplacement(File.separator), "/"), + assertThat(localFiles.get(1).getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir + "subSftpSource")); } diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java index 397592ee5b..2b111faec4 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java @@ -16,8 +16,8 @@ package org.springframework.integration.stomp.client; +import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java index 3080a0ae2f..eb6e27fd39 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2017 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. @@ -16,8 +16,8 @@ package org.springframework.integration.stomp.inbound; +import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java index 7b4c1b71c3..a0bc2f9230 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2017 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. @@ -16,8 +16,8 @@ package org.springframework.integration.stomp.outbound; +import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java index 83d0e9669b..31a50a478e 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 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. @@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import static org.springframework.integration.xml.xpath.XPathUtils.evaluate; import java.util.Date; import java.util.List; @@ -46,6 +45,7 @@ import org.springframework.xml.xpath.NodeMapper; /** * @author Artem Bilan + * @author Gary Russell * @since 3.0 */ @ContextConfiguration @@ -78,19 +78,19 @@ public class XPathTests { @Test @SuppressWarnings("unchecked") public void testXPathUtils() { - Object result = evaluate(XML, "/parent/child/@name"); + Object result = XPathUtils.evaluate(XML, "/parent/child/@name"); assertEquals("test", result); - result = evaluate(XML, "/parent/child/@name", "string"); + result = XPathUtils.evaluate(XML, "/parent/child/@name", "string"); assertEquals("test", result); - result = evaluate(XML, "/parent/child/@age", "number"); + result = XPathUtils.evaluate(XML, "/parent/child/@age", "number"); assertEquals((double) 42, result); - result = evaluate(XML, "/parent/child/@married = 'true'", "boolean"); + result = XPathUtils.evaluate(XML, "/parent/child/@married = 'true'", "boolean"); assertEquals(Boolean.TRUE, result); - result = evaluate(XML, "/parent/child", "node"); + result = XPathUtils.evaluate(XML, "/parent/child", "node"); assertThat(result, Matchers.instanceOf(Node.class)); Node node = (Node) result; assertEquals("child", node.getLocalName()); @@ -98,7 +98,8 @@ public class XPathTests { assertEquals("42", node.getAttributes().getNamedItem("age").getTextContent()); assertEquals("true", node.getAttributes().getNamedItem("married").getTextContent()); - result = evaluate("", "/parent/child", "node_list"); + result = XPathUtils.evaluate("", "/parent/child", + "node_list"); assertThat(result, Matchers.instanceOf(List.class)); List nodeList = (List) result; assertEquals(2, nodeList.size()); @@ -109,7 +110,7 @@ public class XPathTests { assertEquals("child", node2.getLocalName()); assertEquals("bar", node2.getAttributes().getNamedItem("name").getTextContent()); - result = evaluate("", "/parent/child", "document_list"); + result = XPathUtils.evaluate("", "/parent/child", "document_list"); assertThat(result, Matchers.instanceOf(List.class)); List documentList = (List) result; assertEquals(2, documentList.size()); @@ -120,11 +121,11 @@ public class XPathTests { assertEquals("child", document2.getFirstChild().getLocalName()); assertEquals("bar", document2.getFirstChild().getAttributes().getNamedItem("name").getTextContent()); - result = evaluate(XML, "/parent/child/@name", new TestNodeMapper()); + result = XPathUtils.evaluate(XML, "/parent/child/@name", new TestNodeMapper()); assertEquals("test-mapped", result); try { - evaluate(new Date(), "/parent/child"); + XPathUtils.evaluate(new Date(), "/parent/child"); fail("MessagingException expected."); } catch (Exception e) { @@ -133,7 +134,7 @@ public class XPathTests { } try { - evaluate(XML, "/parent/child", "string", "number"); + XPathUtils.evaluate(XML, "/parent/child", "string", "number"); fail("MessagingException expected."); } catch (Exception e) { @@ -142,7 +143,7 @@ public class XPathTests { } try { - evaluate(XML, "/parent/child", "foo"); + XPathUtils.evaluate(XML, "/parent/child", "foo"); fail("MessagingException expected."); } catch (Exception e) { diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java index 9ae350f0f1..08da8797f2 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -16,7 +16,7 @@ package org.springframework.integration.xmpp.inbound; -import static org.hamcrest.core.IsInstanceOf.instanceOf; +import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; @@ -86,7 +86,7 @@ public class ChatMessageListeningEndpointTests { .addAsyncStanzaListener(any(StanzaListener.class), isNull()); willAnswer(invocation -> { - packetListSet.remove((StanzaListener) invocation.getArgument(0)); + packetListSet.remove(invocation.getArgument(0)); return null; }).given(connection) .removeAsyncStanzaListener(any(StanzaListener.class)); diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index aaf729f5bc..008d6c16ab 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -6,7 +6,6 @@ - diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 320541f816..f592dc11b3 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -76,14 +76,29 @@