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:
@ -30,7 +30,7 @@ import units.CommanderUnit;
|
||||
*/
|
||||
public class CommanderTest {
|
||||
@Test
|
||||
public void commanderReady() throws Exception {
|
||||
public void commanderReady() {
|
||||
final Commander commander = new Commander(new CommanderUnit("CommanderUnitTest"));
|
||||
|
||||
commander.commanderReady();
|
||||
|
@ -33,13 +33,13 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
*/
|
||||
public class CommanderUnitTest {
|
||||
@Test
|
||||
public void getUnitExtension() throws Exception {
|
||||
public void getUnitExtension() {
|
||||
|
||||
final Unit unit = new CommanderUnit("CommanderUnitName");
|
||||
|
||||
assertNull(unit.getUnitExtension("SoldierExtension"));
|
||||
assertNull(unit.getUnitExtension("SergeantExtension"));
|
||||
assertNotNull((CommanderExtension) unit.getUnitExtension("CommanderExtension"));
|
||||
assertNotNull(unit.getUnitExtension("CommanderExtension"));
|
||||
}
|
||||
|
||||
}
|
@ -33,12 +33,12 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
*/
|
||||
public class SergeantUnitTest {
|
||||
@Test
|
||||
public void getUnitExtension() throws Exception {
|
||||
public void getUnitExtension() {
|
||||
|
||||
final Unit unit = new SergeantUnit("SergeantUnitName");
|
||||
|
||||
assertNull(unit.getUnitExtension("SoldierExtension"));
|
||||
assertNotNull((SergeantExtension) unit.getUnitExtension("SergeantExtension"));
|
||||
assertNotNull(unit.getUnitExtension("SergeantExtension"));
|
||||
assertNull(unit.getUnitExtension("CommanderExtension"));
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
*/
|
||||
public class SoldierUnitTest {
|
||||
@Test
|
||||
public void getUnitExtension() throws Exception {
|
||||
public void getUnitExtension() {
|
||||
|
||||
final Unit unit = new SoldierUnit("SoldierUnitName");
|
||||
|
||||
assertNotNull((SoldierExtension) unit.getUnitExtension("SoldierExtension"));
|
||||
assertNotNull(unit.getUnitExtension("SoldierExtension"));
|
||||
assertNull(unit.getUnitExtension("SergeantExtension"));
|
||||
assertNull(unit.getUnitExtension("CommanderExtension"));
|
||||
|
||||
|
Reference in New Issue
Block a user