6
6
import org .junit .Test ;
7
7
import org .junit .rules .ExpectedException ;
8
8
9
+ import static io .github .jsonSnapshot .SnapshotMatcher .*;
9
10
import static org .hamcrest .CoreMatchers .startsWith ;
10
11
11
12
public class SnapshotIntegrationTest {
@@ -15,39 +16,39 @@ public class SnapshotIntegrationTest {
15
16
16
17
@ BeforeClass
17
18
public static void beforeAll () {
18
- SnapshotMatcher . start ();
19
+ start ();
19
20
}
20
21
21
22
@ AfterClass
22
23
public static void afterAll () {
23
- SnapshotMatcher . validateSnapshots ();
24
+ validateSnapshots ();
24
25
}
25
26
26
27
@ Test
27
28
public void shouldMatchSnapshotOne () {
28
- SnapshotMatcher . expect (FakeObject .builder ().id ("anyId1" ).value (1 ).name ("anyName1" ).build ()).toMatchSnapshot ();
29
+ expect (FakeObject .builder ().id ("anyId1" ).value (1 ).name ("anyName1" ).build ()).toMatchSnapshot ();
29
30
}
30
31
31
32
@ Test
32
33
public void shouldMatchSnapshotTwo () {
33
- SnapshotMatcher . expect (FakeObject .builder ().id ("anyId2" ).value (2 ).name ("anyName2" ).build ()).toMatchSnapshot ();
34
+ expect (FakeObject .builder ().id ("anyId2" ).value (2 ).name ("anyName2" ).build ()).toMatchSnapshot ();
34
35
}
35
36
36
37
@ Test
37
38
public void shouldMatchSnapshotThree () {
38
- SnapshotMatcher . expect (FakeObject .builder ().id ("anyId3" ).value (3 ).name ("anyName3" ).build ()).toMatchSnapshot ();
39
+ expect (FakeObject .builder ().id ("anyId3" ).value (3 ).name ("anyName3" ).build ()).toMatchSnapshot ();
39
40
}
40
41
41
42
@ Test
42
43
public void shouldMatchSnapshotFour () {
43
- SnapshotMatcher . expect (FakeObject .builder ().id ("anyId4" ).value (4 ).name ("any\n \n \n Name4" ).build ()).toMatchSnapshot ();
44
+ expect (FakeObject .builder ().id ("anyId4" ).value (4 ).name ("any\n \n \n Name4" ).build ()).toMatchSnapshot ();
44
45
}
45
46
46
47
@ Test
47
48
public void shouldMatchSnapshotFive () {
48
49
expectedException .expect (SnapshotMatchException .class );
49
50
expectedException .expectMessage (startsWith ("Error on: \n " +
50
51
"io.github.jsonSnapshot.SnapshotIntegrationTest| with |shouldMatchSnapshotFive=[" ));
51
- SnapshotMatcher . expect (FakeObject .builder ().id ("anyId5" ).value (6 ).name ("anyName5" ).build ()).toMatchSnapshot ();
52
+ expect (FakeObject .builder ().id ("anyId5" ).value (6 ).name ("anyName5" ).build ()).toMatchSnapshot ();
52
53
}
53
54
}
0 commit comments