Skip to content

Commit

Permalink
Merge pull request #969 from alphagov/bau_upgrade_test_deps
Browse files Browse the repository at this point in the history
BAU: Upgrade test dependencies
  • Loading branch information
rhowe-gds authored Jan 15, 2019
2 parents 5e10115 + 2a7fd4a commit 63c914b
Show file tree
Hide file tree
Showing 48 changed files with 123 additions and 132 deletions.
40 changes: 17 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,18 @@
<version>7.9.0</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down Expand Up @@ -378,27 +390,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>2.0.0.0</version>
<version>3.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -416,7 +410,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
<version>2.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -434,7 +428,7 @@
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.2</version>
<version>1.1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -560,7 +554,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<configuration>
<suppressionFiles>
<suppressionFile>project-suppression.xml</suppressionFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import java.util.Map;

import static com.jayway.restassured.RestAssured.given;
import static io.restassured.RestAssured.given;
import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.ArgumentMatchers.anyString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.common.collect.ImmutableMap;
import com.google.gson.JsonObject;
import com.jayway.restassured.response.ValidatableResponse;
import com.jayway.restassured.specification.RequestSpecification;
import io.restassured.response.ValidatableResponse;
import io.restassured.specification.RequestSpecification;
import org.apache.commons.lang.math.RandomUtils;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
Expand All @@ -30,14 +30,14 @@
import java.util.stream.Collectors;

import static com.google.common.collect.Lists.newArrayList;
import static com.jayway.restassured.RestAssured.given;
import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.RestAssured.given;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static org.apache.commons.lang.math.RandomUtils.nextLong;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.Matchers.notNullValue;
import static uk.gov.pay.connector.charge.model.domain.ChargeStatus.AUTHORISATION_SUCCESS;
import static uk.gov.pay.connector.charge.model.domain.ChargeStatus.CREATED;
Expand Down Expand Up @@ -305,7 +305,7 @@ protected String cancelChargeAndCheckApiStatus(String chargeId, ChargeStatus tar
connectorRestApiClient
.withChargeId(chargeId)
.getCharge()
.body("status", isEmptyOrNullString())
.body("status", emptyOrNullString())
.body("state.status", is("cancelled"))
.body("state.finished", is(true))
.body("state.message", is("Payment was cancelled by the service"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasProperty;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ch.qos.logback.core.Appender;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.common.collect.ImmutableMap;
import com.jayway.restassured.RestAssured;
import io.restassured.RestAssured;
import org.hamcrest.core.Is;
import org.junit.After;
import org.junit.Assert;
Expand All @@ -32,9 +32,9 @@
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.RestAssured.given;
import static com.jayway.restassured.config.ConnectionConfig.connectionConfig;
import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.RestAssured.given;
import static io.restassured.config.ConnectionConfig.connectionConfig;
import static io.restassured.http.ContentType.JSON;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import java.lang.reflect.Field;

import static com.jayway.restassured.RestAssured.given;
import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.RestAssured.given;
import static io.restassured.http.ContentType.JSON;
import static io.dropwizard.testing.ConfigOverride.config;
import static java.lang.String.format;
import static org.hamcrest.Matchers.is;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.pay.connector.it.resources;

import com.jayway.restassured.response.ValidatableResponse;
import com.jayway.restassured.specification.RequestSpecification;
import io.restassured.response.ValidatableResponse;
import io.restassured.specification.RequestSpecification;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
Expand All @@ -20,7 +20,7 @@
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.util.Map;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.time.ZonedDateTime;
import java.util.List;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static javax.ws.rs.core.Response.Status.ACCEPTED;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static javax.ws.rs.core.Response.Status.ACCEPTED;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.time.ZonedDateTime;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.core.Is.is;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.util.Arrays.asList;
import static javax.ws.rs.core.Response.Status.OK;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.pay.connector.it.resources;

import com.google.common.collect.ImmutableMap;
import com.jayway.restassured.response.ValidatableResponse;
import io.restassured.response.ValidatableResponse;
import org.junit.Test;
import org.junit.runner.RunWith;
import uk.gov.pay.connector.app.ConnectorApp;
Expand All @@ -12,7 +12,7 @@
import javax.ws.rs.core.Response.Status;
import java.util.HashMap;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.time.temporal.ChronoUnit.SECONDS;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.pay.connector.it.resources;

import com.google.common.collect.ImmutableList;
import com.jayway.restassured.response.ValidatableResponse;
import io.restassured.response.ValidatableResponse;
import org.junit.Test;
import org.junit.runner.RunWith;
import uk.gov.pay.connector.app.ConnectorApp;
Expand All @@ -15,7 +15,7 @@
import java.util.Map;
import java.util.stream.Collectors;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.time.ZonedDateTime.now;
import static java.time.temporal.ChronoUnit.DAYS;
import static java.util.Arrays.asList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.time.ZoneOffset;
import java.time.ZonedDateTime;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static java.time.ZonedDateTime.now;
import static java.time.temporal.ChronoUnit.SECONDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import javax.ws.rs.core.HttpHeaders;
import java.time.ZonedDateTime;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.time.ZonedDateTime.now;
import static java.time.temporal.ChronoUnit.HOURS;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.Response.Status.OK;
import static org.apache.commons.lang.math.RandomUtils.nextLong;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.text.MatchesPattern.matchesPattern;
Expand Down Expand Up @@ -108,7 +108,7 @@ public void shouldGetExpectedTransactionsByChargeReferenceAndStatusesForBothChar
.body("count", is(2))
.body("page", is(1))
.body("_links.next_page.href", is(expectedChargesLocationFor(accountId, "?reference=ref-3&page=2&display_size=2&payment_states=timedout%2Csuccess&refund_states=submitted")))
.body("_links.prev_page", isEmptyOrNullString())
.body("_links.prev_page", emptyOrNullString())
.body("_links.first_page.href", is(expectedChargesLocationFor(accountId, "?reference=ref-3&page=1&display_size=2&payment_states=timedout%2Csuccess&refund_states=submitted")))
.body("_links.last_page.href", is(expectedChargesLocationFor(accountId, "?reference=ref-3&page=2&display_size=2&payment_states=timedout%2Csuccess&refund_states=submitted")))
.body("_links.self.href", is(expectedChargesLocationFor(accountId, "?reference=ref-3&page=1&display_size=2&payment_states=timedout%2Csuccess&refund_states=submitted")))
Expand Down Expand Up @@ -140,8 +140,8 @@ public void shouldGetExpectedTransactionsByChargeReferenceAndStatusesForBothChar
.body("results[1].email", is(email))
.body("results[1].state.finished", is(false))
.body("results[1].state.status", is("submitted"))
.body("results[1].state.code", is(isEmptyOrNullString()))
.body("results[1].state.message", is(isEmptyOrNullString()))
.body("results[1].state.code", is(emptyOrNullString()))
.body("results[1].state.message", is(emptyOrNullString()))
.body("results[1].card_details.card_brand", is("Visa"))
.body("results[1].card_details.cardholder_name", is(cardHolderName))
.body("results[1].card_details.expiry_date", is(expiryDate))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.pay.connector.it.resources;

import com.google.common.collect.ImmutableMap;
import com.jayway.restassured.response.ValidatableResponse;
import io.restassured.response.ValidatableResponse;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -21,7 +21,7 @@
import javax.ws.rs.core.HttpHeaders;
import java.util.List;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static java.lang.String.format;
import static java.time.temporal.ChronoUnit.SECONDS;
import static java.util.Arrays.asList;
Expand All @@ -39,7 +39,7 @@
import static org.apache.commons.lang.math.RandomUtils.nextLong;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
Expand Down Expand Up @@ -213,7 +213,7 @@ public void shouldUpdateChargeStatusToEnteringCardDetails() {
.withChargeId(chargeId)
.putChargeStatus(putBody)
.statusCode(NO_CONTENT.getStatusCode())
.body(isEmptyOrNullString());
.body(emptyOrNullString());

validateGetCharge(expectedAmount, chargeId, ENTERING_CARD_DETAILS, true);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.pay.connector.it.resources;

import com.google.common.collect.ImmutableMap;
import com.jayway.restassured.response.ValidatableResponse;
import io.restassured.response.ValidatableResponse;
import junitparams.Parameters;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -15,7 +15,7 @@
import java.util.Map;
import java.util.Optional;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.junit.Test;
import uk.gov.pay.connector.rules.DropwizardAppWithPostgresRule;

import static com.jayway.restassured.RestAssured.given;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;

public class DatabaseConnectionITest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.HashMap;
import java.util.Map;

import static com.jayway.restassured.http.ContentType.JSON;
import static io.restassured.http.ContentType.JSON;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
Expand Down
Loading

0 comments on commit 63c914b

Please sign in to comment.