提交 86e9c66c 编写于 作者: H hoangNam

- Assign new clubberTroll instance to another variable.

- Remove redundant Exception from throws list in unit tests.
上级 a6e6c22b
......@@ -57,9 +57,9 @@ public class App {
// change the behavior of the simple troll by adding a decorator
LOGGER.info("A troll with huge club surprises you.");
troll = new ClubbedTroll(troll);
troll.attack();
troll.fleeBattle();
LOGGER.info("Clubbed troll power {}.\n", troll.getAttackPower());
Troll clubbedTroll = new ClubbedTroll(troll);
clubbedTroll.attack();
clubbedTroll.fleeBattle();
LOGGER.info("Clubbed troll power {}.\n", clubbedTroll.getAttackPower());
}
}
......@@ -36,7 +36,7 @@ import static org.mockito.internal.verification.VerificationModeFactory.times;
public class ClubbedTrollTest {
@Test
public void testClubbedTroll() throws Exception {
public void testClubbedTroll() {
// Create a normal troll first, but make sure we can spy on it later on.
final Troll simpleTroll = spy(new SimpleTroll());
......
......@@ -53,7 +53,7 @@ public class SimpleTrollTest {
}
@Test
public void testTrollActions() throws Exception {
public void testTrollActions() {
final SimpleTroll troll = new SimpleTroll();
assertEquals(10, troll.getAttackPower());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册