2323
2424package com .iluwatar .model .view .controller ;
2525
26- import org .junit .jupiter .api .Test ;
27-
2826import static org .mockito .Mockito .mock ;
2927import static org .mockito .Mockito .verify ;
3028import static org .mockito .Mockito .verifyNoMoreInteractions ;
3129import static org .mockito .Mockito .verifyZeroInteractions ;
3230
31+ import org .junit .jupiter .api .Test ;
32+
3333/**
3434 * Date: 12/20/15 - 2:19 PM
3535 *
@@ -42,19 +42,20 @@ public class GiantControllerTest {
4242 */
4343 @ Test
4444 public void testSetHealth () {
45- final GiantModel model = mock (GiantModel .class );
46- final GiantView view = mock (GiantView .class );
47- final GiantController controller = new GiantController (model , view );
45+ final var model = mock (GiantModel .class );
46+ final var view = mock (GiantView .class );
47+ final var controller = new GiantController (model , view );
4848
4949 verifyZeroInteractions (model , view );
5050
51- for (final Health health : Health .values ()) {
51+ for (final var health : Health .values ()) {
5252 controller .setHealth (health );
5353 verify (model ).setHealth (health );
5454 verifyZeroInteractions (view );
5555 }
5656
5757 controller .getHealth ();
58+ //noinspection ResultOfMethodCallIgnored
5859 verify (model ).getHealth ();
5960
6061 verifyNoMoreInteractions (model , view );
@@ -65,19 +66,20 @@ public void testSetHealth() {
6566 */
6667 @ Test
6768 public void testSetFatigue () {
68- final GiantModel model = mock (GiantModel .class );
69- final GiantView view = mock (GiantView .class );
70- final GiantController controller = new GiantController (model , view );
69+ final var model = mock (GiantModel .class );
70+ final var view = mock (GiantView .class );
71+ final var controller = new GiantController (model , view );
7172
7273 verifyZeroInteractions (model , view );
7374
74- for (final Fatigue fatigue : Fatigue .values ()) {
75+ for (final var fatigue : Fatigue .values ()) {
7576 controller .setFatigue (fatigue );
7677 verify (model ).setFatigue (fatigue );
7778 verifyZeroInteractions (view );
7879 }
7980
8081 controller .getFatigue ();
82+ //noinspection ResultOfMethodCallIgnored
8183 verify (model ).getFatigue ();
8284
8385 verifyNoMoreInteractions (model , view );
@@ -88,29 +90,30 @@ public void testSetFatigue() {
8890 */
8991 @ Test
9092 public void testSetNourishment () {
91- final GiantModel model = mock (GiantModel .class );
92- final GiantView view = mock (GiantView .class );
93- final GiantController controller = new GiantController (model , view );
93+ final var model = mock (GiantModel .class );
94+ final var view = mock (GiantView .class );
95+ final var controller = new GiantController (model , view );
9496
9597 verifyZeroInteractions (model , view );
9698
97- for (final Nourishment nourishment : Nourishment .values ()) {
99+ for (final var nourishment : Nourishment .values ()) {
98100 controller .setNourishment (nourishment );
99101 verify (model ).setNourishment (nourishment );
100102 verifyZeroInteractions (view );
101103 }
102104
103105 controller .getNourishment ();
106+ //noinspection ResultOfMethodCallIgnored
104107 verify (model ).getNourishment ();
105108
106109 verifyNoMoreInteractions (model , view );
107110 }
108111
109112 @ Test
110113 public void testUpdateView () {
111- final GiantModel model = mock (GiantModel .class );
112- final GiantView view = mock (GiantView .class );
113- final GiantController controller = new GiantController (model , view );
114+ final var model = mock (GiantModel .class );
115+ final var view = mock (GiantView .class );
116+ final var controller = new GiantController (model , view );
114117
115118 verifyZeroInteractions (model , view );
116119
0 commit comments