GeezerVison is showing github.com — Fix failing tests (#1591) · bodorismail/java-docs-samples@f951adf
File tree
Expand file treeCollapse file tree
Open diff view settings
vision/cloud-client/src/test/java/com/example/vision
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: vision/cloud-client/src/test/java/com/example/vision/DetectIT.java +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
27 | 27 | import java.io.IOException; |
28 | 28 | import java.io.PrintStream; |
29 | 29 | import java.util.UUID; |
| 30 | +import java.util.regex.Pattern; |
30 | 31 |
|
31 | 32 | import org.junit.After; |
32 | 33 | import org.junit.Before; |
@@ -46,7 +47,7 @@ public class DetectIT { |
46 | 47 | private static final String OUTPUT_PREFIX = "OCR_PDF_TEST_OUTPUT_" + UUID.randomUUID().toString(); |
47 | 48 |
|
48 | 49 | @Before |
49 | | - public void setUp() throws IOException { |
| 50 | + public void setUp() { |
50 | 51 | bout = new ByteArrayOutputStream(); |
51 | 52 | out = new PrintStream(bout); |
52 | 53 | System.setOut(out); |
@@ -312,8 +313,8 @@ public void testCropHints() throws Exception { |
312 | 313 | // Assert |
313 | 314 | String got = bout.toString(); |
314 | 315 | assertThat(got).contains("vertices {"); |
315 | | - assertThat(got).contains("x: 599"); |
316 | | - assertThat(got).contains("y: 475"); |
| 316 | + assertThat(got).containsMatch(Pattern.compile("x: 2\\d{2}")); |
| 317 | + assertThat(got).containsMatch(Pattern.compile("y: 4\\d{2}")); |
317 | 318 | } |
318 | 319 |
|
319 | 320 | @Test |
@@ -325,8 +326,8 @@ public void testCropHintsGcs() throws Exception { |
325 | 326 | // Assert |
326 | 327 | String got = bout.toString(); |
327 | 328 | assertThat(got).contains("vertices {"); |
328 | | - assertThat(got).contains("x: 599"); |
329 | | - assertThat(got).contains("y: 475"); |
| 329 | + assertThat(got).containsMatch(Pattern.compile("x: 2\\d{2}")); |
| 330 | + assertThat(got).containsMatch(Pattern.compile("y: 4\\d{2}")); |
330 | 331 | } |
331 | 332 |
|
332 | 333 | @Test |
|