|
35 | 35 | import org.testfx.framework.junit5.Start; |
36 | 36 | import org.testfx.framework.junit5.Stop; |
37 | 37 |
|
38 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
| 38 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 39 | +import static org.junit.jupiter.api.Assertions.assertNotEquals; |
39 | 40 | import static org.mockito.Mockito.mock; |
40 | 41 | import static org.mockito.Mockito.when; |
41 | 42 |
|
@@ -71,19 +72,25 @@ public void stop(){ |
71 | 72 | } |
72 | 73 |
|
73 | 74 | @Test |
74 | | - public void defaultOnNullStatus() { |
75 | | - when(service.getLatestStatus()).thenReturn(StageStatus.NULL); |
| 75 | + @SetSystemProperty(key = ConfigurableSystemProperty.PDFSAM_DISABLE_UI_RESTORE, value = "true") |
| 76 | + public void defaultOnDisableRestore() { |
| 77 | + when(service.getLatestStatus()).thenReturn(new StageStatus(10, 10, 10, 10)); |
76 | 78 | victim.setStage(victimStage); |
77 | 79 | robot.clickOn("show").sleep(200); |
78 | | - assertTrue(victimStage.isMaximized()); |
| 80 | + assertNotEquals(10, victimStage.getX()); |
| 81 | + assertNotEquals(10, victimStage.getY()); |
| 82 | + assertNotEquals(10, victimStage.getWidth()); |
| 83 | + assertNotEquals(10, victimStage.getHeight()); |
79 | 84 | } |
80 | 85 |
|
81 | 86 | @Test |
82 | | - @SetSystemProperty(key = ConfigurableSystemProperty.PDFSAM_DISABLE_UI_RESTORE, value = "true") |
83 | | - public void defaultOnDisableRestore() { |
| 87 | + void restoreLastStatus() { |
84 | 88 | when(service.getLatestStatus()).thenReturn(new StageStatus(10, 10, 10, 10)); |
85 | 89 | victim.setStage(victimStage); |
86 | 90 | robot.clickOn("show").sleep(200); |
87 | | - assertTrue(victimStage.isMaximized()); |
| 91 | + assertEquals(10, victimStage.getX()); |
| 92 | + assertEquals(10, victimStage.getY()); |
| 93 | + assertEquals(10, victimStage.getWidth()); |
| 94 | + assertEquals(10, victimStage.getHeight()); |
88 | 95 | } |
89 | 96 | } |
0 commit comments