move BeforeEach to top of class

This commit is contained in:
danielmcnally285 2024-03-19 20:02:44 +00:00
parent ab35aeabf7
commit 9439463838
1 changed files with 6 additions and 6 deletions

View File

@ -15,6 +15,12 @@ public class LastNCharactersUnitTest {
private String s;
private int n;
@BeforeEach
void init() {
s = "10-03-2024";
n = 4;
}
@Test
void givenString_whenUsingIntStreamAsStreamSource_thenObtainLastNCharacters() {
String result = s.chars()
@ -55,10 +61,4 @@ public class LastNCharactersUnitTest {
assertThat(result).isEqualTo("2024");
}
@BeforeEach
void init() {
s = "10-03-2024";
n = 4;
}
}