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:
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
public class QueenTest {
|
||||
|
||||
@Test
|
||||
public void testNotFlirtyUncomplemented() throws Exception {
|
||||
public void testNotFlirtyUncomplemented() {
|
||||
final Queen queen = new Queen();
|
||||
queen.setFlirtiness(false);
|
||||
queen.changeMood();
|
||||
@ -44,7 +44,7 @@ public class QueenTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotFlirtyComplemented() throws Exception {
|
||||
public void testNotFlirtyComplemented() {
|
||||
final Queen queen = new Queen();
|
||||
queen.setFlirtiness(false);
|
||||
queen.receiveCompliments();
|
||||
@ -53,14 +53,14 @@ public class QueenTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFlirtyUncomplemented() throws Exception {
|
||||
public void testFlirtyUncomplemented() {
|
||||
final Queen queen = new Queen();
|
||||
queen.changeMood();
|
||||
assertFalse(queen.getMood());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFlirtyComplemented() throws Exception {
|
||||
public void testFlirtyComplemented() {
|
||||
final Queen queen = new Queen();
|
||||
queen.receiveCompliments();
|
||||
queen.changeMood();
|
||||
|
@ -41,7 +41,7 @@ import static org.mockito.Mockito.when;
|
||||
public class ServantTest {
|
||||
|
||||
@Test
|
||||
public void testFeed() throws Exception {
|
||||
public void testFeed() {
|
||||
final Royalty royalty = mock(Royalty.class);
|
||||
final Servant servant = new Servant("test");
|
||||
servant.feed(royalty);
|
||||
@ -50,7 +50,7 @@ public class ServantTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGiveWine() throws Exception {
|
||||
public void testGiveWine() {
|
||||
final Royalty royalty = mock(Royalty.class);
|
||||
final Servant servant = new Servant("test");
|
||||
servant.giveWine(royalty);
|
||||
@ -59,7 +59,7 @@ public class ServantTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGiveCompliments() throws Exception {
|
||||
public void testGiveCompliments() {
|
||||
final Royalty royalty = mock(Royalty.class);
|
||||
final Servant servant = new Servant("test");
|
||||
servant.giveCompliments(royalty);
|
||||
@ -68,7 +68,7 @@ public class ServantTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckIfYouWillBeHanged() throws Exception {
|
||||
public void testCheckIfYouWillBeHanged() {
|
||||
final Royalty goodMoodRoyalty = mock(Royalty.class);
|
||||
when(goodMoodRoyalty.getMood()).thenReturn(true);
|
||||
|
||||
|
Reference in New Issue
Block a user