Skip to content

Commit a818683

Browse files
committed
Update README file and add static imports
1 parent 145058c commit a818683

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ Add to your pom.xml dependencies section:
3333
```java
3434
package com.example;
3535

36-
import com.github.andrebonna.jsonSnapshot.*;
36+
import static io.github.jsonSnapshot.SnapshotMatcher.*;
3737

3838
public class ExampleTest {
3939
@BeforeClass
4040
public static void beforeAll() {
41-
SnapshotMatcher.start();
41+
start();
4242
}
4343

4444
@AfterClass
4545
public static void afterAll() {
46-
SnapshotMatcher.validateSnapshots();
46+
validateSnapshots();
4747
}
4848

4949
@Test
5050
public void shouldShowSnapshotExample() {
51-
SnapshotMatcher.expect("<any type of object>").toMatchSnapshot();
51+
expect("<any type of object>").toMatchSnapshot();
5252
}
5353
}
5454
```

src/test/java/io/github/jsonSnapshot/SnapshotIntegrationTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.junit.Test;
77
import org.junit.rules.ExpectedException;
88

9+
import static io.github.jsonSnapshot.SnapshotMatcher.*;
910
import static org.hamcrest.CoreMatchers.startsWith;
1011

1112
public class SnapshotIntegrationTest {
@@ -15,39 +16,39 @@ public class SnapshotIntegrationTest {
1516

1617
@BeforeClass
1718
public static void beforeAll() {
18-
SnapshotMatcher.start();
19+
start();
1920
}
2021

2122
@AfterClass
2223
public static void afterAll() {
23-
SnapshotMatcher.validateSnapshots();
24+
validateSnapshots();
2425
}
2526

2627
@Test
2728
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();
2930
}
3031

3132
@Test
3233
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();
3435
}
3536

3637
@Test
3738
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();
3940
}
4041

4142
@Test
4243
public void shouldMatchSnapshotFour() {
43-
SnapshotMatcher.expect(FakeObject.builder().id("anyId4").value(4).name("any\n\n\nName4").build()).toMatchSnapshot();
44+
expect(FakeObject.builder().id("anyId4").value(4).name("any\n\n\nName4").build()).toMatchSnapshot();
4445
}
4546

4647
@Test
4748
public void shouldMatchSnapshotFive() {
4849
expectedException.expect(SnapshotMatchException.class);
4950
expectedException.expectMessage(startsWith("Error on: \n" +
5051
"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();
5253
}
5354
}

0 commit comments

Comments
 (0)