Skip to content

Commit e8a597b

Browse files
committed
- Updated test names to reflect what it is testing
1 parent d102bbe commit e8a597b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core-java-modules/core-java-io-2/src/test/java/com/baeldung/scanner/JavaScannerUnitTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ public void whenReadingPartialLines_thenCorrect() {
2929
}
3030

3131
@Test(expected = NoSuchElementException.class)
32-
public void whenReadingLines_thenThrowNoSuchElementException() {
32+
33+
public void givenNoNewLine_whenReadingNextLine_thenThrowNoSuchElementException() {
3334
try (Scanner scanner = new Scanner("")) {
3435
String result = scanner.nextLine();
3536
}
3637
}
3738

3839
@Test(expected = IllegalStateException.class)
39-
public void whenReadingLines_thenThrowIllegalStateException() {
40+
public void givenScannerIsClosed_whenReadingNextLine_thenThrowIllegalStateException() {
4041
Scanner scanner = new Scanner("");
4142
scanner.close();
4243
String result = scanner.nextLine();

0 commit comments

Comments
 (0)