move BeforeEach to top of class
This commit is contained in:
parent
ab35aeabf7
commit
9439463838
@ -15,6 +15,12 @@ public class LastNCharactersUnitTest {
|
|||||||
private String s;
|
private String s;
|
||||||
private int n;
|
private int n;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void init() {
|
||||||
|
s = "10-03-2024";
|
||||||
|
n = 4;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void givenString_whenUsingIntStreamAsStreamSource_thenObtainLastNCharacters() {
|
void givenString_whenUsingIntStreamAsStreamSource_thenObtainLastNCharacters() {
|
||||||
String result = s.chars()
|
String result = s.chars()
|
||||||
@ -55,10 +61,4 @@ public class LastNCharactersUnitTest {
|
|||||||
|
|
||||||
assertThat(result).isEqualTo("2024");
|
assertThat(result).isEqualTo("2024");
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
void init() {
|
|
||||||
s = "10-03-2024";
|
|
||||||
n = 4;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user