Skip to content

Commit 1bd2ea4

Browse files
committed
Squash a few warnings in tests
1 parent 4473aa1 commit 1bd2ea4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ protected void releaseResources() throws IOException {
230230
consumeN(DLQ, MSG_COUNT, WithResponse.NULL);
231231
}
232232

233+
@SuppressWarnings("unchecked")
233234
@Test public void deadLetterPerMessageTTLRemoved() throws Exception {
234235
declareQueue(TEST_QUEUE_NAME, DLX, null, null, 1);
235236
channel.queueBind(TEST_QUEUE_NAME, "amq.direct", "test");
@@ -247,11 +248,10 @@ protected void releaseResources() throws IOException {
247248
assertNull(getResponse.getProps().getExpiration());
248249
Map<String, Object> headers = getResponse.getProps().getHeaders();
249250
assertNotNull(headers);
250-
ArrayList<Object> death = (ArrayList<Object>)headers.get("x-death");
251+
ArrayList<Object> death = (ArrayList<Object>) headers.get("x-death");
251252
assertNotNull(death);
252253
assertDeathReason(death, 0, TEST_QUEUE_NAME, "expired");
253-
final Map<String, Object> deathHeader =
254-
(Map<String, Object>)death.get(0);
254+
final Map<String, Object> deathHeader = (Map<String, Object>) death.get(0);
255255
assertEquals("100", deathHeader.get("original-expiration").toString());
256256
});
257257
}
@@ -287,6 +287,7 @@ protected void releaseResources() throws IOException {
287287
publishN(MSG_COUNT);
288288
}
289289

290+
@SuppressWarnings("unchecked")
290291
@Test public void deadLetterTwice() throws Exception {
291292
declareQueue(TEST_QUEUE_NAME, DLX, null, null, 1);
292293

@@ -308,7 +309,7 @@ protected void releaseResources() throws IOException {
308309
consumeN(DLQ2, MSG_COUNT*2, getResponse -> {
309310
Map<String, Object> headers = getResponse.getProps().getHeaders();
310311
assertNotNull(headers);
311-
ArrayList<Object> death = (ArrayList<Object>)headers.get("x-death");
312+
ArrayList<Object> death = (ArrayList<Object>) headers.get("x-death");
312313
assertNotNull(death);
313314
if (death.size() == 1) {
314315
assertDeathReason(death, 0, TEST_QUEUE_NAME, "expired");
@@ -357,6 +358,7 @@ public void handleDelivery(String consumerTag, Envelope envelope,
357358
assertTrue(latch.await(10, TimeUnit.SECONDS));
358359
}
359360

361+
@SuppressWarnings("unchecked")
360362
@Test public void deadLetterNewRK() throws Exception {
361363
declareQueue(TEST_QUEUE_NAME, DLX, "test-other", null, 1);
362364

@@ -510,6 +512,7 @@ private void deadLetterTest(Callable<?> deathTrigger,
510512
consume(channel, reason);
511513
}
512514

515+
@SuppressWarnings("unchecked")
513516
public static void consume(final Channel channel, final String reason) throws IOException {
514517
consumeN(channel, DLQ, MSG_COUNT, getResponse -> {
515518
Map<String, Object> headers = getResponse.getProps().getHeaders();

0 commit comments

Comments
 (0)