Skip to content

Commit

Permalink
Remove redundant use of stdin manipulation in the NotificationTruncat…
Browse files Browse the repository at this point in the history
…eTest
  • Loading branch information
PaulBoon committed Sep 10, 2024
1 parent 1e4defa commit 46b07ef
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 46b07ef

Please sign in to comment.