Revisit Assert to avoid single-arg assert methods (with refined messages)
Issue: SPR-15196
This commit is contained in:
@@ -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.
|
||||
@@ -159,7 +159,7 @@ public class ReactorNettyTcpStompClientTests {
|
||||
private final List<String> received = new ArrayList<>();
|
||||
|
||||
public ConsumingHandler(String... topics) {
|
||||
Assert.notEmpty(topics);
|
||||
Assert.notEmpty(topics, "Topics must not be empty");
|
||||
this.topics = Arrays.asList(topics);
|
||||
this.subscriptionLatch = new CountDownLatch(this.topics.size());
|
||||
}
|
||||
@@ -168,7 +168,6 @@ public class ReactorNettyTcpStompClientTests {
|
||||
return this.received;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterConnected(StompSession session, StompHeaders connectedHeaders) {
|
||||
for (String topic : this.topics) {
|
||||
|
||||
@@ -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.
|
||||
@@ -399,7 +399,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
|
||||
}
|
||||
|
||||
public static MessageExchangeBuilder disconnectWithReceipt(String sessionId, String receiptId) {
|
||||
|
||||
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.DISCONNECT);
|
||||
headers.setSessionId(sessionId);
|
||||
headers.setReceipt(receiptId);
|
||||
@@ -411,7 +410,7 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
|
||||
}
|
||||
|
||||
public MessageExchangeBuilder andExpectMessage(String sessionId, String subscriptionId) {
|
||||
Assert.isTrue(SimpMessageType.MESSAGE.equals(headers.getMessageType()));
|
||||
Assert.state(SimpMessageType.MESSAGE.equals(this.headers.getMessageType()), "MESSAGE type expected");
|
||||
String destination = this.headers.getDestination();
|
||||
Object payload = this.message.getPayload();
|
||||
this.expected.add(new StompMessageFrameMessageMatcher(sessionId, subscriptionId, destination, payload));
|
||||
@@ -420,7 +419,7 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
|
||||
|
||||
public MessageExchangeBuilder andExpectError() {
|
||||
String sessionId = this.headers.getSessionId();
|
||||
Assert.notNull(sessionId, "No sessionId to match the ERROR frame to");
|
||||
Assert.state(sessionId != null, "No sessionId to match the ERROR frame to");
|
||||
return andExpectError(sessionId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user