Skip to content

Commit dfd8b0c

Browse files
committed
Amend the test method names to include a when and remove unused throws
1 parent 4f7cb84 commit dfd8b0c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core-java-8/src/test/java/com/baeldung/RandomListElementTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
public class RandomListElementTest {
1010

1111
@Test
12-
public void givenList_shouldReturnARandomElement1() throws Exception {
12+
public void givenList_whenRandomNumberChosen_shouldReturnARandomElement() {
1313
List<Integer> givenList = Arrays.asList(1, 2, 3);
1414
Random rand = new Random();
15-
16-
Integer result = givenList.get(rand.nextInt(givenList.size()));
15+
givenList.get(rand.nextInt(givenList.size()));
1716
}
1817
}

0 commit comments

Comments
 (0)