File tree 3 files changed +6
-6
lines changed
main/java/com/iluwatar/decorator
test/java/com/iluwatar/decorator
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ public static void main(String[] args) {
57
57
58
58
// change the behavior of the simple troll by adding a decorator
59
59
LOGGER .info ("A troll with huge club surprises you." );
60
- troll = new ClubbedTroll (troll );
61
- troll .attack ();
62
- troll .fleeBattle ();
63
- LOGGER .info ("Clubbed troll power {}.\n " , troll .getAttackPower ());
60
+ Troll clubbedTroll = new ClubbedTroll (troll );
61
+ clubbedTroll .attack ();
62
+ clubbedTroll .fleeBattle ();
63
+ LOGGER .info ("Clubbed troll power {}.\n " , clubbedTroll .getAttackPower ());
64
64
}
65
65
}
Original file line number Diff line number Diff line change 36
36
public class ClubbedTrollTest {
37
37
38
38
@ Test
39
- public void testClubbedTroll () throws Exception {
39
+ public void testClubbedTroll () {
40
40
// Create a normal troll first, but make sure we can spy on it later on.
41
41
final Troll simpleTroll = spy (new SimpleTroll ());
42
42
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public void tearDown() {
53
53
}
54
54
55
55
@ Test
56
- public void testTrollActions () throws Exception {
56
+ public void testTrollActions () {
57
57
final SimpleTroll troll = new SimpleTroll ();
58
58
assertEquals (10 , troll .getAttackPower ());
59
59
You can’t perform that action at this time.
0 commit comments