diff --git a/src/test/java/nl/knaw/dans/dvcli/command/NotificationTruncateTest.java b/src/test/java/nl/knaw/dans/dvcli/command/NotificationTruncateTest.java index 4b51fc9..55cbd1d 100644 --- a/src/test/java/nl/knaw/dans/dvcli/command/NotificationTruncateTest.java +++ b/src/test/java/nl/knaw/dans/dvcli/command/NotificationTruncateTest.java @@ -37,11 +37,8 @@ public class NotificationTruncateTest extends AbstractCapturingTest { - private final InputStream originalStdin = System.in; - @Test public void doCall_with_wrong_database_connection_fails() throws Exception { - System.setIn(originalStdin); var database = Mockito.mock(Database.class); doThrow(new SQLException("test database fails to connect")).when(database).connect(); @@ -59,8 +56,6 @@ public void doCall_with_wrong_database_connection_fails() throws Exception { @Test public void doCall_with_negative_numberOfRecordsToKeep_fails() throws Exception { - System.setIn(originalStdin); - var database = Mockito.mock(Database.class); var userOptions = new NotificationTruncate.UserOptions(); @@ -76,8 +71,6 @@ public void doCall_with_negative_numberOfRecordsToKeep_fails() throws Exception @Test public void doCall_with_several_users_to_truncate_notifications_works() throws Exception { - System.setIn(originalStdin); - var database = Mockito.mock(Database.class); Mockito.doNothing().when(database).connect();