|
12 | 12 | */ |
13 | 13 | package io.specto.hoverfly.junit.core; |
14 | 14 |
|
| 15 | +import static io.specto.hoverfly.junit.core.HoverflyConfig.localConfigs; |
| 16 | +import static io.specto.hoverfly.junit.core.HoverflyMode.CAPTURE; |
| 17 | +import static io.specto.hoverfly.junit.core.HoverflyMode.DIFF; |
| 18 | +import static io.specto.hoverfly.junit.core.HoverflyUtils.checkPortInUse; |
| 19 | +import static io.specto.hoverfly.junit.core.HoverflyUtils.readSimulationFromString; |
| 20 | +import static io.specto.hoverfly.junit.dsl.matchers.HoverflyMatchers.any; |
| 21 | +import static io.specto.hoverfly.junit.verification.HoverflyVerifications.atLeastOnce; |
| 22 | +import static io.specto.hoverfly.junit.verification.HoverflyVerifications.never; |
| 23 | +import static io.specto.hoverfly.junit.verification.HoverflyVerifications.times; |
| 24 | + |
| 25 | +import com.fasterxml.jackson.databind.ObjectMapper; |
| 26 | +import com.fasterxml.jackson.databind.ObjectWriter; |
| 27 | +import io.specto.hoverfly.junit.api.HoverflyClient; |
| 28 | +import io.specto.hoverfly.junit.api.HoverflyClientException; |
| 29 | +import io.specto.hoverfly.junit.api.model.ModeArguments; |
| 30 | +import io.specto.hoverfly.junit.api.view.DiffView; |
| 31 | +import io.specto.hoverfly.junit.api.view.HoverflyInfoView; |
| 32 | +import io.specto.hoverfly.junit.api.view.StateView; |
| 33 | +import io.specto.hoverfly.junit.core.config.HoverflyConfiguration; |
| 34 | +import io.specto.hoverfly.junit.core.model.Journal; |
| 35 | +import io.specto.hoverfly.junit.core.model.Request; |
| 36 | +import io.specto.hoverfly.junit.core.model.RequestResponsePair; |
| 37 | +import io.specto.hoverfly.junit.core.model.Simulation; |
| 38 | +import io.specto.hoverfly.junit.dsl.RequestMatcherBuilder; |
| 39 | +import io.specto.hoverfly.junit.dsl.StubServiceBuilder; |
| 40 | +import io.specto.hoverfly.junit.verification.HoverflyComparisonFailure; |
| 41 | +import io.specto.hoverfly.junit.verification.VerificationCriteria; |
| 42 | +import io.specto.hoverfly.junit.verification.VerificationData; |
15 | 43 | import java.io.File; |
16 | 44 | import java.io.IOException; |
17 | 45 | import java.io.OutputStream; |
|
32 | 60 | import java.util.concurrent.TimeUnit; |
33 | 61 | import java.util.concurrent.TimeoutException; |
34 | 62 | import java.util.stream.Stream; |
35 | | - |
36 | | -import com.fasterxml.jackson.databind.ObjectMapper; |
37 | | -import com.fasterxml.jackson.databind.ObjectWriter; |
38 | | -import io.specto.hoverfly.junit.api.HoverflyClient; |
39 | | -import io.specto.hoverfly.junit.api.HoverflyClientException; |
40 | | -import io.specto.hoverfly.junit.api.model.ModeArguments; |
41 | | -import io.specto.hoverfly.junit.api.view.DiffView; |
42 | | -import io.specto.hoverfly.junit.api.view.HoverflyInfoView; |
43 | | -import io.specto.hoverfly.junit.api.view.StateView; |
44 | | -import io.specto.hoverfly.junit.core.config.HoverflyConfiguration; |
45 | | -import io.specto.hoverfly.junit.core.model.Journal; |
46 | | -import io.specto.hoverfly.junit.core.model.Request; |
47 | | -import io.specto.hoverfly.junit.core.model.RequestResponsePair; |
48 | | -import io.specto.hoverfly.junit.core.model.Simulation; |
49 | | -import io.specto.hoverfly.junit.dsl.RequestMatcherBuilder; |
50 | | -import io.specto.hoverfly.junit.dsl.StubServiceBuilder; |
51 | | -import io.specto.hoverfly.junit.verification.VerificationCriteria; |
52 | | -import io.specto.hoverfly.junit.verification.VerificationData; |
53 | 63 | import org.apache.commons.lang3.StringUtils; |
54 | | -import org.junit.Assert; |
55 | 64 | import org.slf4j.Logger; |
56 | 65 | import org.slf4j.LoggerFactory; |
57 | 66 | import org.zeroturnaround.exec.ProcessExecutor; |
58 | 67 | import org.zeroturnaround.exec.StartedProcess; |
59 | 68 |
|
60 | | -import static io.specto.hoverfly.junit.core.HoverflyConfig.localConfigs; |
61 | | -import static io.specto.hoverfly.junit.core.HoverflyMode.CAPTURE; |
62 | | -import static io.specto.hoverfly.junit.core.HoverflyMode.DIFF; |
63 | | -import static io.specto.hoverfly.junit.core.HoverflyUtils.checkPortInUse; |
64 | | -import static io.specto.hoverfly.junit.core.HoverflyUtils.readSimulationFromString; |
65 | | -import static io.specto.hoverfly.junit.dsl.matchers.HoverflyMatchers.any; |
66 | | -import static io.specto.hoverfly.junit.verification.HoverflyVerifications.atLeastOnce; |
67 | | -import static io.specto.hoverfly.junit.verification.HoverflyVerifications.never; |
68 | | -import static io.specto.hoverfly.junit.verification.HoverflyVerifications.times; |
69 | | - |
70 | 69 | /** |
71 | 70 | * A wrapper class for the Hoverfly binary. Manage the lifecycle of the processes, and then manage Hoverfly itself by using it's API endpoints. |
72 | 71 | */ |
@@ -494,7 +493,7 @@ public void assertThatNoDiffIsReported(boolean shouldResetDiff) { |
494 | 493 | if (shouldResetDiff) { |
495 | 494 | hoverflyClient.cleanDiffs(); |
496 | 495 | } |
497 | | - Assert.fail(message.toString()); |
| 496 | + throw new HoverflyComparisonFailure(message.toString(), diffs); |
498 | 497 | } |
499 | 498 | } |
500 | 499 |
|
|
0 commit comments