Skip to content

Commit 96f7a84

Browse files
committed
Use same state value in condition and error message
1 parent 2f38d5c commit 96f7a84

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/ResourceBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected void checkOpen() {
4343
throw new AmqpException.AmqpResourceClosedException("Resource is closed");
4444
} else if (state != OPEN) {
4545
throw new AmqpException.AmqpResourceInvalidStateException(
46-
"Resource is not open, current state is %s", this.state.get().name());
46+
"Resource is not open, current state is %s", state.name());
4747
}
4848
}
4949

src/test/java/com/rabbitmq/client/amqp/impl/AmqpConsumerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void init(TestInfo info) {
5454

5555
@AfterEach
5656
void tearDown() {
57+
waitAtMost(Duration.ofSeconds(5), () -> ((ResourceBase) connection).state() == OPEN);
5758
connection.management().queueDeletion().delete(this.q);
5859
}
5960

0 commit comments

Comments
 (0)