Commit 20a7c17 1 parent 9142df5 commit 20a7c17 Copy full SHA for 20a7c17
File tree 2 files changed +22
-1
lines changed
main/java/ru/namibios/arduino/model/bot
test/java/ru/namibios/arduino/model/bot
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class StartFishState extends State{
11
11
12
12
private static final Logger LOG = Logger .getLogger (StartFishState .class );
13
13
14
- private final PauseService pauseService ;
14
+ private PauseService pauseService ;
15
15
16
16
StartFishState (FishBot fishBot ) {
17
17
super (fishBot );
Original file line number Diff line number Diff line change 9
9
import org .mockito .MockitoAnnotations ;
10
10
import org .mockito .runners .MockitoJUnitRunner ;
11
11
import ru .namibios .arduino .config .Application ;
12
+ import ru .namibios .arduino .model .bot .service .PauseService ;
12
13
import ru .namibios .arduino .model .bot .service .input .InputService ;
13
14
import ru .namibios .arduino .model .command .Command ;
14
15
@@ -26,6 +27,9 @@ public class StartFishStateTest {
26
27
@ Mock
27
28
private InputService inputService ;
28
29
30
+ @ Mock
31
+ private PauseService pauseService ;
32
+
29
33
@ InjectMocks
30
34
private StartFishState startFishState ;
31
35
@@ -36,6 +40,23 @@ public void setUp() {
36
40
37
41
}
38
42
43
+ @ Test
44
+ public void testPause () throws IOException {
45
+
46
+ Application .getInstance ().setProperty ("bot.state.skip_calendar" , "false" );
47
+
48
+ Mockito .when (pauseService .isReady ()).thenReturn (true );
49
+ Mockito .when (inputService .send (any (Command .class ))).thenReturn (true );
50
+
51
+ startFishState .onStep ();
52
+
53
+ Mockito .verify (inputService ).send (any (Command .class ));
54
+ Mockito .verify (fishBot ).setState (isA (PersonalMessageState .class ));
55
+ Mockito .verify (pauseService ).isReady ();
56
+ Mockito .verify (pauseService ).rest ();
57
+
58
+ }
59
+
39
60
@ Test
40
61
public void testStart () throws IOException {
41
62
You can’t perform that action at this time.
0 commit comments