Skip to content

Commit 0af4aba

Browse files
committed
Bump hoverfly version to v1.3.0
1 parent 778e40d commit 0af4aba

File tree

13 files changed

+28
-35
lines changed

13 files changed

+28
-35
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version=0.13.2-SNAPSHOT
22
title=Hoverfly Java
33
description=Hoverfly for Java. Capture and simulate HTTP(S) services in JUnit tests.
4-
hoverfly_binary_version=v1.1.5
4+
hoverfly_binary_version=v1.3.0

junit5/src/test/java/io/specto/hoverfly/junit5/HoverflyDefaultCoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@ExtendWith(HoverflyExtension.class)
2020
class HoverflyDefaultCoreTest {
2121

22-
private OkHttpClient client = new OkHttpClient();
22+
private final OkHttpClient client = new OkHttpClient();
2323

2424
@Test
2525
void shouldBeAbleToSimulate(Hoverfly hoverfly) throws IOException {

src/main/java/io/specto/hoverfly/junit/core/model/HoverflyMetaData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public class HoverflyMetaData {
2626

2727
private static final List<String> EXCLUDED_FIELDS = Arrays.asList("hoverflyVersion", "timeExported");
2828

29-
private String schemaVersion;
29+
private final String schemaVersion;
3030
private String hoverflyVersion;
3131
private String timeExported;
3232

3333
public HoverflyMetaData() {
34-
schemaVersion = "v5";
34+
schemaVersion = "v5.1";
3535
}
3636

3737
@JsonCreator
@@ -69,4 +69,4 @@ public int hashCode() {
6969
public String toString() {
7070
return ToStringBuilder.reflectionToString(this);
7171
}
72-
}
72+
}

src/test/java/io/specto/hoverfly/junit/api/OkHttpHoverflyClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,6 @@ private void assertSimulationIsSetAndUpgraded(String resourcePath) throws IOExce
281281

282282
Simulation exportedSimulation = hoverfly.getSimulation();
283283
assertThat(exportedSimulation.getHoverflyData().getPairs()).hasSize(1);
284-
assertThat(exportedSimulation.getHoverflyMetaData().getSchemaVersion()).isEqualTo("v5");
284+
assertThat(exportedSimulation.getHoverflyMetaData().getSchemaVersion()).isEqualTo("v5.1");
285285
}
286286
}

src/test/java/io/specto/hoverfly/junit/core/SimulationSourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void shouldCreateSimulationFromSimulationObject() throws Exception {
141141
public void shouldCreateEmptySimulation() throws JSONException {
142142
JSONAssert.assertEquals(
143143
SimulationSource.empty().getSimulation(),
144-
"{\"data\":{\"pairs\":[],\"globalActions\":{\"delays\":[]}},\"meta\":{\"schemaVersion\":\"v5\"}}",
144+
"{\"data\":{\"pairs\":[],\"globalActions\":{\"delays\":[]}},\"meta\":{\"schemaVersion\":\"v5.1\"}}",
145145
false);
146146
}
147147

src/test/java/io/specto/hoverfly/junit/core/model/SimulationTest.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
package io.specto.hoverfly.junit.core.model;
22

33

4+
import static io.specto.hoverfly.junit.core.model.RequestFieldMatcher.newExactMatcher;
5+
import static java.util.Collections.singletonList;
6+
import static org.assertj.core.api.Assertions.assertThat;
7+
48
import com.fasterxml.jackson.databind.ObjectMapper;
59
import com.google.common.collect.ImmutableList;
610
import com.google.common.collect.ImmutableMap;
711
import com.google.common.collect.Lists;
812
import com.google.common.collect.Sets;
913
import com.google.common.io.Resources;
14+
import java.net.URL;
15+
import java.nio.charset.StandardCharsets;
16+
import java.util.Collections;
1017
import org.junit.Test;
1118
import org.skyscreamer.jsonassert.JSONAssert;
1219
import org.skyscreamer.jsonassert.JSONCompareMode;
1320

14-
import java.net.URL;
15-
import java.nio.charset.Charset;
16-
import java.util.Collections;
17-
18-
import static io.specto.hoverfly.junit.core.model.RequestFieldMatcher.*;
19-
import static java.util.Collections.singletonList;
20-
import static org.assertj.core.api.Assertions.assertThat;
21-
2221
public class SimulationTest {
2322

2423

25-
private ObjectMapper objectMapper = new ObjectMapper();
24+
private final ObjectMapper objectMapper = new ObjectMapper();
2625

27-
private URL v1Resource = Resources.getResource("simulations/v1-simulation.json");
28-
private URL v1ResourceWithLooseMatching = Resources.getResource("simulations/v1-simulation-with-loose-matching.json");
29-
private URL v1ResourceWithRecording = Resources.getResource("simulations/v1-simulation-with-recording.json");
30-
private URL v2Resource = Resources.getResource("simulations/v2-simulation.json");
31-
private URL v3Resource = Resources.getResource("simulations/v3-simulation.json");
32-
private URL v4Resource = Resources.getResource("simulations/v4-simulation.json");
33-
private URL v5Resource = Resources.getResource("simulations/v5-simulation.json");
34-
private URL v5ResourceWithoutGlobalActions = Resources.getResource("simulations/v5-simulation-without-global-actions.json");
35-
private URL v5ResourceWithUnknownFields = Resources.getResource("simulations/v5-simulation-with-unknown-fields.json");
26+
private final URL v5Resource = Resources.getResource("simulations/v5-simulation.json");
27+
private final URL v5ResourceWithoutGlobalActions = Resources.getResource("simulations/v5-simulation-without-global-actions.json");
28+
private final URL v5ResourceWithUnknownFields = Resources.getResource("simulations/v5-simulation-with-unknown-fields.json");
3629

3730

3831
@Test
@@ -56,7 +49,7 @@ public void shouldSerialize() throws Exception {
5649
String actual = objectMapper.writeValueAsString(simulation);
5750

5851
// then
59-
String expected = Resources.toString(v5Resource, Charset.forName("UTF-8"));
52+
String expected = Resources.toString(v5Resource, StandardCharsets.UTF_8);
6053
JSONAssert.assertEquals(expected, actual, JSONCompareMode.STRICT);
6154
}
6255

@@ -74,7 +67,7 @@ public void shouldIgnoreUnknownPropertiesWhenDeserialize() throws Exception {
7467

7568
@Test
7669
public void shouldNotIncludeNullGlobalActionsFieldWhenSerialize() throws Exception{
77-
String expected = Resources.toString(v5ResourceWithoutGlobalActions, Charset.forName("UTF-8"));
70+
String expected = Resources.toString(v5ResourceWithoutGlobalActions, StandardCharsets.UTF_8);
7871

7972
Simulation simulation = objectMapper.readValue(expected, Simulation.class);
8073

@@ -121,4 +114,4 @@ private HoverflyData getTestHoverflyData(Request.Builder testRequestBuilder, Res
121114
Sets.newHashSet(new RequestResponsePair(testRequestBuilder.build(), testResponseBuilder.build())),
122115
new GlobalActions(Collections.emptyList()));
123116
}
124-
}
117+
}

src/test/java/io/specto/hoverfly/ruletest/CaptureModeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class CaptureModeTest {
3838
localConfigs().captureAllHeaders().proxyLocalHost());
3939

4040
private URI webServerBaseUrl;
41-
private RestTemplate restTemplate = new RestTemplate();
41+
private final RestTemplate restTemplate = new RestTemplate();
4242

4343
// We have to assert after the rule has executed because that's when the classpath is written to the filesystem
4444
@AfterClass

src/test/resources/expected-simulation-other.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
}
5656
},
5757
"meta": {
58-
"schemaVersion": "v5"
58+
"schemaVersion": "v5.1"
5959
}
6060
}

src/test/resources/expected-simulation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
}
5656
},
5757
"meta": {
58-
"schemaVersion": "v5"
58+
"schemaVersion": "v5.1"
5959
}
6060
}

src/test/resources/simulations/v5-simulation-with-unknown-fields.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@
8484
}
8585
},
8686
"meta": {
87-
"schemaVersion": "v5"
87+
"schemaVersion": "v5.1"
8888
}
8989
}

0 commit comments

Comments
 (0)