From 606d26ed20f669744c56777761929540d1da1ee6 Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Wed, 20 Jan 2021 13:43:05 +1100 Subject: [PATCH] chore: split out more objects from large test - failing on JDK 10 #1286 --- .../pact/consumer/PactDslJsonBodyTest.java | 76 ++++--------------- 1 file changed, 14 insertions(+), 62 deletions(-) diff --git a/consumer/src/test/java/au/com/dius/pact/consumer/PactDslJsonBodyTest.java b/consumer/src/test/java/au/com/dius/pact/consumer/PactDslJsonBodyTest.java index a4dbb14782..fa6105b37d 100644 --- a/consumer/src/test/java/au/com/dius/pact/consumer/PactDslJsonBodyTest.java +++ b/consumer/src/test/java/au/com/dius/pact/consumer/PactDslJsonBodyTest.java @@ -325,6 +325,12 @@ public void largeBodyTest() { .booleanType("bulbIncluded", false) .decimalType("voltage", 10.10) .decimalType("wattage", 10.10); + PactDslJsonBody dimensions = new PactDslJsonBody() + .decimalType("length", 10.10) + .decimalType("width", 10.10) + .decimalType("height", 10.10) + .decimalType("pileHeight", 10.10) + .stringType("uom", "METRE"); DslPart body = new PactDslJsonBody() .object("metadata", metadata) .integerType("version", 1) @@ -368,13 +374,7 @@ public void largeBodyTest() { .closeObject() .closeArray().asBody() .object("weightsAndMeasures") - .object("dimensions") - .decimalType("length", 10.10) - .decimalType("width", 10.10) - .decimalType("height", 10.10) - .decimalType("pileHeight", 10.10) - .stringType("uom", "METRE") - .closeObject().asBody() + .object("dimensions", dimensions) .object("weight") .decimalType("weight", 10.10) .decimalType("netWeight", 10.10) @@ -411,13 +411,7 @@ public void largeBodyTest() { .minArrayLike("packages", 1) .integerType("packageType", 1) .object("weightsAndMeasures") - .object("dimensions") - .decimalType("length", 10.10) - .decimalType("width", 10.10) - .decimalType("height", 10.10) - .decimalType("pileHeight", 10.10) - .stringType("uom", "METRE") - .closeObject().asBody() + .object("dimensions", dimensions) .object("weight") .decimalType("weight", 10.10) .decimalType("netWeight", 10.10) @@ -512,42 +506,12 @@ public void largeBodyTest() { .closeObject().asBody() .object("division") .stringType("masterSource", "DIV") - .object("title") - .stringType("mainTitle", "Lorem ipsum dolor sit amet, consectetur adipiscing elit") - .stringType("webTitle", "sample_data") - .minArrayLike("attributes", 1) - .stringType("key", "sample_data") - .stringType("value", "sample_data") - .closeObject() - .closeArray().asBody() - .closeObject().asBody() - .object("description") - .stringType("longDescription", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus pellentesque eu tincidunt tortor aliquam nulla facilisi cras. Nunc sed id semper risus in. Sit amet consectetur adipiscing elit pellentesque. Gravida neque convallis a cras. Auctor augue mauris augue neque gravida. Lectus quam id leo in vitae turpis massa sed elementum. Quisque sagittis purus sit amet volutpat consequat. Interdum velit euismod in pellentesque massa. Eu scelerisque felis imperdiet proin fermentum leo. Vel orci porta non pulvinar neque laoreet suspendisse. Netus et malesuada fames ac turpis egestas maecenas pharetra convallis. Sagittis aliquam malesuada bibendum arcu vitae. Risus in hendrerit gravida rutrum. Varius duis at consectetur lorem donec massa sapien. Platea dictumst quisque sagittis purus sit amet volutpat. Dui sapien eget mi proin sed libero enim. Tincidunt praesent semper feugiat nibh sed pulvinar. Sollicitudin tempor id eu nisl nunc mi. Hac habitasse platea dictumst vestibulum rhoncus.") - .stringType("shortDescription", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus pellentesque eu tincidunt tortor aliquam nulla facilisi cras. Nunc sed id semper risus in. Sit amet consectetur adipiscing elit pellentesque. Gravida neque convallis a cras. Auctor augue mauris augue neque gravida.") - .minArrayLike("attributes", 1) - .stringType("key", "sample_data") - .stringType("value", "sample_data") - .closeObject() - .closeArray().asBody() - .closeObject().asBody() + .object("title", title) + .object("description", description) .object("brand") - .stringType("name", "sample_data") - .closeObject().asBody() - .object("productSpecification") - .integerType("multiPackQuantity", 1) - .booleanType("copyrightInd", false) - .stringType("copyrightDets", "sample_data") - .booleanType("batteryRequired", true) - .booleanType("batteryIncluded", false) - .booleanType("beabApproved", false) - .stringType("beabCertNo", "sample_data") - .booleanType("plugRequired", false) - .booleanType("plugIncluded", false) - .booleanType("bulbRequired", false) - .booleanType("bulbIncluded", false) - .decimalType("voltage", 10.10) - .decimalType("wattage", 10.10) + .stringType("name", "sample_data") .closeObject().asBody() + .object("productSpecification", productSpecification) .minArrayLike("attributes", 1) .stringType("scope", "DESCRIPTIVE") .stringType("key", "sample_data") @@ -563,13 +527,7 @@ public void largeBodyTest() { .closeObject() .closeArray().asBody() .object("weightsAndMeasures") - .object("dimensions") - .decimalType("length", 10.10) - .decimalType("width", 10.10) - .decimalType("height", 10.10) - .decimalType("pileHeight", 10.10) - .stringType("uom", "METRE") - .closeObject().asBody() + .object("dimensions", dimensions) .object("weight") .decimalType("weight", 10.10) .decimalType("netWeight", 10.10) @@ -606,13 +564,7 @@ public void largeBodyTest() { .minArrayLike("packages", 1) .integerType("packageType", 1) .object("weightsAndMeasures") - .object("dimensions") - .decimalType("length", 10.10) - .decimalType("width", 10.10) - .decimalType("height", 10.10) - .decimalType("pileHeight", 10.10) - .stringType("uom", "METRE") - .closeObject().asBody() + .object("dimensions", dimensions) .object("weight") .decimalType("weight", 10.10) .decimalType("netWeight", 10.10)