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
This commit is contained in:
Gary Russell
2017-03-05 22:19:01 -05:00
committed by Artem Bilan
parent dd0c426d14
commit 37683f1b80
13 changed files with 70 additions and 52 deletions

View File

@@ -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));