From c45ba3ea273739fea6ac78446cf58ff016c74039 Mon Sep 17 00:00:00 2001 From: Cristiano Nicolai Date: Wed, 22 Apr 2020 01:48:04 +1000 Subject: [PATCH] KOGITO-1943 - Add integration tests with Infinispan --- pom.xml | 6 + .../pom.xml | 33 +++-- .../org/acme/{travels => deals}/Address.java | 18 ++- .../acme/{travels => deals}/Traveller.java | 18 ++- .../resources/org/acme/deals/reviewDeal.bpmn | 6 +- .../resources/org/acme/deals/submitDeal.bpmn | 6 +- .../test/java/org/acme/deals/DealsRestIT.java | 99 +++++++++++++++ .../src/test/resources/application.properties | 4 + .../pom.xml | 35 +++++- .../org/acme/{travels => deals}/Address.java | 18 ++- .../org/acme/deals/KogitoApplication.java | 28 +++++ .../acme/{travels => deals}/Traveller.java | 18 ++- ...KogitoInfinispanSpringbootApplication.java | 14 --- .../src/main/resources/reviewDeal.bpmn | 6 +- .../src/main/resources/submitDeal.bpmn | 6 +- .../test/java/org/acme/deals/DealsRestIT.java | 113 ++++++++++++++++++ 16 files changed, 387 insertions(+), 41 deletions(-) rename process-infinispan-persistence-quarkus/src/main/java/org/acme/{travels => deals}/Address.java (59%) rename process-infinispan-persistence-quarkus/src/main/java/org/acme/{travels => deals}/Traveller.java (66%) create mode 100644 process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java create mode 100644 process-infinispan-persistence-quarkus/src/test/resources/application.properties rename process-infinispan-persistence-springboot/src/main/java/org/acme/{travels => deals}/Address.java (59%) create mode 100644 process-infinispan-persistence-springboot/src/main/java/org/acme/deals/KogitoApplication.java rename process-infinispan-persistence-springboot/src/main/java/org/acme/{travels => deals}/Traveller.java (66%) delete mode 100644 process-infinispan-persistence-springboot/src/main/java/org/kie/kogito/tests/KogitoInfinispanSpringbootApplication.java create mode 100644 process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java diff --git a/pom.xml b/pom.xml index 243191c484..227cd7aff1 100755 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ 10.1.5.Final 2.2.3.Final + quay.io/infinispan/server:${infinispan.version} 1.12.4 2.4.0 @@ -171,6 +172,11 @@ testcontainers ${version.testcontainers} + + org.testcontainers + junit-jupiter + ${version.testcontainers} + com.jayway.jsonpath json-path diff --git a/process-infinispan-persistence-quarkus/pom.xml b/process-infinispan-persistence-quarkus/pom.xml index a4a4f57347..e5d3859b68 100644 --- a/process-infinispan-persistence-quarkus/pom.xml +++ b/process-infinispan-persistence-quarkus/pom.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0"> 4.0.0 @@ -16,9 +16,6 @@ Kogito Examples :: Process Infinispan Persistence Quarkus Process with Infinispan persistence - Quarkus - - - @@ -47,7 +44,6 @@ io.quarkus quarkus-smallrye-openapi - org.kie.kogito infinispan-persistence-addon @@ -62,7 +58,11 @@ rest-assured test - + + org.testcontainers + junit-jupiter + test + ${project.artifactId} @@ -86,6 +86,23 @@ + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + org.jboss.logmanager.LogManager + ${container.image.infinispan} + + + diff --git a/process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Address.java b/process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Address.java similarity index 59% rename from process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Address.java rename to process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Address.java index 68b329b577..40dc3e5303 100644 --- a/process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Address.java +++ b/process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Address.java @@ -1,4 +1,20 @@ -package org.acme.travels; +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; public class Address { diff --git a/process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Traveller.java b/process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java similarity index 66% rename from process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Traveller.java rename to process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java index b4659ec261..9bd0deceaa 100644 --- a/process-infinispan-persistence-quarkus/src/main/java/org/acme/travels/Traveller.java +++ b/process-infinispan-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java @@ -1,4 +1,20 @@ -package org.acme.travels; +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; public class Traveller { diff --git a/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/reviewDeal.bpmn b/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/reviewDeal.bpmn index e5a49fbd5b..360a2c00df 100644 --- a/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/reviewDeal.bpmn +++ b/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/reviewDeal.bpmn @@ -2,7 +2,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/submitDeal.bpmn b/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/submitDeal.bpmn index 4b51f8d37d..c005aeda44 100644 --- a/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/submitDeal.bpmn +++ b/process-infinispan-persistence-quarkus/src/main/resources/org/acme/deals/submitDeal.bpmn @@ -2,9 +2,9 @@ - + - + @@ -71,7 +71,7 @@ _A186F5CE-4300-4506-A89D-50DEDC8F24CF - + _C3082C6F-963E-40A2-B31B-1E8F336AA4C6_dealInputX diff --git a/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java b/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java new file mode 100644 index 0000000000..4d5c22f486 --- /dev/null +++ b/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; + +import java.util.Map; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; +import org.kie.api.definition.type.ClassReactive; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.FixedHostPortGenericContainer; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@Testcontainers +@QuarkusTest +public class DealsRestIT { + + private static final Logger LOGGER = LoggerFactory.getLogger(DealsRestIT.class); + + @Container + public static GenericContainer INFINISPAN = new FixedHostPortGenericContainer(System.getProperty("container.image.infinispan")) + .withFixedExposedPort(11222, 11222) + .withEnv("USER", "admin") + .withEnv("PASS", "admin") + .withLogConsumer(new Slf4jLogConsumer(LOGGER)) + .waitingFor(Wait.forLogMessage(".*ISPN080001.*", 1)); + + @Test + public void testDealsRest() { + // test adding new deal + String addDealPayload = "{\"name\" : \"my fancy deal\", \"traveller\" : { \"firstName\" : \"John\", \"lastName\" : \"Doe\", \"email\" : \"jon.doe@example.com\", \"nationality\" : \"American\",\"address\" : { \"street\" : \"main street\", \"city\" : \"Boston\", \"zipCode\" : \"10005\", \"country\" : \"US\" }}}"; + String dealId = given().contentType(ContentType.JSON).accept(ContentType.JSON).body(addDealPayload) + .when().post("/deals") + .then().log().ifValidationFails().statusCode(200).body("id", notNullValue()).extract().path("id"); + + // test getting the created deal + given().accept(ContentType.JSON) + .when().get("/deals") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + + // test getting order by id + given().accept(ContentType.JSON) + .when().get("/deals/" + dealId) + .then().log().ifValidationFails().statusCode(200).body("id", is(dealId)); + + // get deals for review + String dealReviewId = given().accept(ContentType.JSON) + .when().get("/dealreviews") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + + // get task for john + Map tasks = given().accept(ContentType.JSON) + .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) + .then().log().ifValidationFails().statusCode(200).extract().as(Map.class); + assertNotNull(tasks); + assertEquals(1, tasks.size()); + + // complete review task + given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") + .when().post("/dealreviews/{uuid}/review/{tuuid}?user=john", dealReviewId, tasks.keySet().iterator().next()) + .then().log().ifValidationFails().statusCode(200); + + //verify no deals to review + given().accept(ContentType.JSON) + .when().get("/dealreviews") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + + //verify no deals + given().accept(ContentType.JSON) + .when().get("/deals") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + } +} \ No newline at end of file diff --git a/process-infinispan-persistence-quarkus/src/test/resources/application.properties b/process-infinispan-persistence-quarkus/src/test/resources/application.properties new file mode 100644 index 0000000000..03b05663ee --- /dev/null +++ b/process-infinispan-persistence-quarkus/src/test/resources/application.properties @@ -0,0 +1,4 @@ +# Infinispan +quarkus.infinispan-client.use-auth=true +quarkus.infinispan-client.auth-username=admin +quarkus.infinispan-client.auth-password=admin \ No newline at end of file diff --git a/process-infinispan-persistence-springboot/pom.xml b/process-infinispan-persistence-springboot/pom.xml index ffbf016d4a..8db093177d 100644 --- a/process-infinispan-persistence-springboot/pom.xml +++ b/process-infinispan-persistence-springboot/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 org.kie.kogito @@ -68,6 +68,16 @@ spring-boot-starter-test test + + io.rest-assured + rest-assured + test + + + org.testcontainers + junit-jupiter + test + @@ -118,6 +128,25 @@ + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + ${project.build.outputDirectory} + + ${container.image.infinispan} + + + diff --git a/process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Address.java b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Address.java similarity index 59% rename from process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Address.java rename to process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Address.java index 68b329b577..40dc3e5303 100644 --- a/process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Address.java +++ b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Address.java @@ -1,4 +1,20 @@ -package org.acme.travels; +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; public class Address { diff --git a/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/KogitoApplication.java b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/KogitoApplication.java new file mode 100644 index 0000000000..76c9b84b6b --- /dev/null +++ b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/KogitoApplication.java @@ -0,0 +1,28 @@ +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication(scanBasePackages = {"org.kie.kogito.**", "org.acme.deals.**"}) +public class KogitoApplication { + + public static void main(String[] args) { + SpringApplication.run(KogitoApplication.class, args); + } +} diff --git a/process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Traveller.java b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Traveller.java similarity index 66% rename from process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Traveller.java rename to process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Traveller.java index b4659ec261..9bd0deceaa 100644 --- a/process-infinispan-persistence-springboot/src/main/java/org/acme/travels/Traveller.java +++ b/process-infinispan-persistence-springboot/src/main/java/org/acme/deals/Traveller.java @@ -1,4 +1,20 @@ -package org.acme.travels; +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; public class Traveller { diff --git a/process-infinispan-persistence-springboot/src/main/java/org/kie/kogito/tests/KogitoInfinispanSpringbootApplication.java b/process-infinispan-persistence-springboot/src/main/java/org/kie/kogito/tests/KogitoInfinispanSpringbootApplication.java deleted file mode 100644 index ac39b5bc93..0000000000 --- a/process-infinispan-persistence-springboot/src/main/java/org/kie/kogito/tests/KogitoInfinispanSpringbootApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.kie.kogito.tests; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication(scanBasePackages={"org.kie.kogito.**","org.acme.deals.**"}) -public class KogitoInfinispanSpringbootApplication { - - public static void main(String[] args) { - SpringApplication.run(KogitoInfinispanSpringbootApplication.class, args); - } - - -} diff --git a/process-infinispan-persistence-springboot/src/main/resources/reviewDeal.bpmn b/process-infinispan-persistence-springboot/src/main/resources/reviewDeal.bpmn index e5a49fbd5b..360a2c00df 100644 --- a/process-infinispan-persistence-springboot/src/main/resources/reviewDeal.bpmn +++ b/process-infinispan-persistence-springboot/src/main/resources/reviewDeal.bpmn @@ -2,7 +2,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/process-infinispan-persistence-springboot/src/main/resources/submitDeal.bpmn b/process-infinispan-persistence-springboot/src/main/resources/submitDeal.bpmn index 4b51f8d37d..c005aeda44 100644 --- a/process-infinispan-persistence-springboot/src/main/resources/submitDeal.bpmn +++ b/process-infinispan-persistence-springboot/src/main/resources/submitDeal.bpmn @@ -2,9 +2,9 @@ - + - + @@ -71,7 +71,7 @@ _A186F5CE-4300-4506-A89D-50DEDC8F24CF - + _C3082C6F-963E-40A2-B31B-1E8F336AA4C6_dealInputX diff --git a/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java b/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java new file mode 100644 index 0000000000..4515a7b903 --- /dev/null +++ b/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.acme.deals; + +import java.util.Map; + +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; +import org.testcontainers.containers.FixedHostPortGenericContainer; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@Testcontainers +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { + "infinispan.remote.use-auth=true", + "infinispan.remote.auth-username=admin", + "infinispan.remote.auth-password=admin", + "infinispan.remote.sasl-mechanism=DIGEST-MD5" +}) +public class DealsRestIT { + + private static final Logger LOGGER = LoggerFactory.getLogger(DealsRestIT.class); + + @Container + public static GenericContainer INFINISPAN = new FixedHostPortGenericContainer(System.getProperty("container.image.infinispan")) + .withFixedExposedPort(11222, 11222) + .withEnv("USER", "admin") + .withEnv("PASS", "admin") + .waitingFor(Wait.forLogMessage(".*ISPN080001.*", 1)); + + @LocalServerPort + int randomServerPort; + + @BeforeEach + public void setup() { + RestAssured.port = randomServerPort; + } + + @Test + public void testDealsRest() { + // test adding new deal + String addDealPayload = "{\"name\" : \"my fancy deal\", \"traveller\" : { \"firstName\" : \"John\", \"lastName\" : \"Doe\", \"email\" : \"jon.doe@example.com\", \"nationality\" : \"American\",\"address\" : { \"street\" : \"main street\", \"city\" : \"Boston\", \"zipCode\" : \"10005\", \"country\" : \"US\" }}}"; + String dealId = given().contentType(ContentType.JSON).accept(ContentType.JSON).body(addDealPayload) + .when().post("/deals") + .then().log().ifValidationFails().statusCode(200).body("id", notNullValue()).extract().path("id"); + + // test getting the created deal + given().accept(ContentType.JSON) + .when().get("/deals") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + + // test getting order by id + given().accept(ContentType.JSON) + .when().get("/deals/" + dealId) + .then().log().ifValidationFails().statusCode(200).body("id", is(dealId)); + + // get deals for review + String dealReviewId = given().accept(ContentType.JSON) + .when().get("/dealreviews") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + + // get task for john + Map tasks = given().accept(ContentType.JSON) + .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) + .then().log().ifValidationFails().statusCode(200).extract().as(Map.class); + assertNotNull(tasks); + assertEquals(1, tasks.size()); + + // complete review task + given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") + .when().post("/dealreviews/{uuid}/review/{tuuid}?user=john", dealReviewId, tasks.keySet().iterator().next()) + .then().log().ifValidationFails().statusCode(200); + + //verify no deals to review + given().accept(ContentType.JSON) + .when().get("/dealreviews") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + + //verify no deals + given().accept(ContentType.JSON) + .when().get("/deals") + .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + } +} \ No newline at end of file