Minor refactorings and code style changes (#807)

* Made minor changes in some patterns such as removed throws clause where not needed, changed incorrect order of arguments in assertEquals

* Minor refactorings and code style changes. 1) Removed several use of raw types 2) Removed unnecessary throws clauses 3) Used lambda expressions wherever applicable 4) Used apt assertion methods for readability 5) Use of try with resources wherever applicable 6) Corrected incorrect order of assertXXX arguments

* Removed unused import from Promise

* Addressed review comments

* Addressed checkstyle issue
This commit is contained in:
Narendra Pathai authored and GitHub committed 2018-10-23 13:45:41 +05:30
1 parent 25ed7c09c5
commit 2aa9e78ddd
112 files changed
+312 -463

No files matched your search

@@ -36,38 +36,34 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class PoisonMessageTest {
@Test
public void testAddHeader() throws Exception {
public void testAddHeader() {
assertThrows(UnsupportedOperationException.class, () -> {
POISON_PILL.addHeader(Headers.SENDER, "sender");
});
}
@Test
public void testGetHeader() throws Exception {
public void testGetHeader() {
assertThrows(UnsupportedOperationException.class, () -> {
POISON_PILL.getHeader(Headers.SENDER);
});
}
@Test
public void testGetHeaders() throws Exception {
assertThrows(UnsupportedOperationException.class, () -> {
POISON_PILL.getHeaders();
});
public void testGetHeaders() {
assertThrows(UnsupportedOperationException.class, POISON_PILL::getHeaders);
}
@Test
public void testSetBody() throws Exception {
public void testSetBody() {
assertThrows(UnsupportedOperationException.class, () -> {
POISON_PILL.setBody("Test message.");
});
}
@Test
public void testGetBody() throws Exception {
assertThrows(UnsupportedOperationException.class, () -> {
POISON_PILL.getBody();
});
public void testGetBody() {
assertThrows(UnsupportedOperationException.class, POISON_PILL::getBody);
}
}