Skip to content

Commit

Permalink
Merge pull request #966 from alphagov/dependabot/maven/org.junit.jupi…
Browse files Browse the repository at this point in the history
…ter-junit-jupiter-api-5.7.0

Bump junit-jupiter-api from 5.6.2 to 5.7.0
  • Loading branch information
oswaldquek authored Dec 23, 2020
2 parents dfaf2a3 + d64168b commit c65245a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<testcontainers.version>1.15.1</testcontainers.version>
<postgresql.version>42.2.18</postgresql.version>
<pay-java-commons.version>1.0.20201130170501</pay-java-commons.version>
<junit5.version>5.6.2</junit5.version>
<junit5.version>5.7.0</junit5.version>
<surefire.version>3.0.0-M5</surefire.version>
<guice.version>4.2.3</guice.version>
<rest-assured.version>4.3.3</rest-assured.version>
Expand Down Expand Up @@ -182,7 +182,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import static uk.gov.pay.ledger.util.fixture.QueuePaymentEventFixture.aQueuePaymentEventFixture;

@ExtendWith(DropwizardExtensionsSupport.class)
public class QueueMessageReceiverForTransactionIT {
class QueueMessageReceiverForTransactionIT {

@RegisterExtension
public static AppWithPostgresAndSqsExtension rule = new AppWithPostgresAndSqsExtension(
static AppWithPostgresAndSqsExtension rule = new AppWithPostgresAndSqsExtension(
config("queueMessageReceiverConfig.backgroundProcessingEnabled", "true"));

private final String gatewayAccountId = "test_gateway_account_id";
Expand All @@ -35,7 +35,7 @@ public class QueueMessageReceiverForTransactionIT {
"false",
"null"
})
public void paymentCreatedMessageIsPersistedCorrectly(Boolean moto) throws InterruptedException {
void paymentCreatedMessageIsPersistedCorrectly(Boolean moto) throws InterruptedException {
String resourceExternalId = RandomStringUtils.random(10, true, true);
aQueuePaymentEventFixture()
.withResourceExternalId(resourceExternalId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,77 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class TransactionSearchParamsValidatorTest {
class TransactionSearchParamsValidatorTest {

TransactionSearchParams searchParams;
private TransactionSearchParams searchParams;

@BeforeEach
public void setup() {
void setup() {
searchParams = new TransactionSearchParams();
}

@Test
public void shouldThrowException_whenInvalidFromDate() {
void shouldThrowException_whenInvalidFromDate() {
searchParams.setFromDate("wrong-date");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
assertThat(unparsableDateException.getMessage(), is("Input from_date (wrong-date) is wrong format"));
}

@Test
public void shouldThrowException_whenInvalidToDate() {
void shouldThrowException_whenInvalidToDate() {
searchParams.setToDate("wrong-date");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
assertThat(unparsableDateException.getMessage(), is("Input to_date (wrong-date) is wrong format"));
}

@Test
public void shouldThrowException_whenInvalidFromSettledDate() {
void shouldThrowException_whenInvalidFromSettledDate() {
searchParams.setFromSettledDate("wrong-date");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
assertThat(unparsableDateException.getMessage(), is("Input from_settled_date (wrong-date) is wrong format"));
}

@Test
public void shouldThrowException_whenInvalidToSettledDate() {
void shouldThrowException_whenInvalidToSettledDate() {
searchParams.setToSettledDate("wrong-date");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
assertThat(unparsableDateException.getMessage(), is("Input to_settled_date (wrong-date) is wrong format"));
}

@Test
public void shouldNotThrowException_whenValidDateFormats() {
void shouldNotThrowException_whenValidDateFormats() {
searchParams.setFromDate("2019-05-01T10:15:30Z");
searchParams.setToDate("2019-05-01T10:15:30Z");
TransactionSearchParamsValidator.validateSearchParams(searchParams, null);
}

@Test
public void shouldNotThrowException_whenValidSettledDateFormats() {
void shouldNotThrowException_whenValidSettledDateFormats() {
searchParams.setFromSettledDate("2020-09-10");
searchParams.setToSettledDate("2020-09-10");
TransactionSearchParamsValidator.validateSearchParams(searchParams, null);
}

@Test
public void validateSearchParamsForCsvShouldNotThrowExceptionForValidParams() {
void validateSearchParamsForCsvShouldNotThrowExceptionForValidParams() {
searchParams.setFromDate("2019-05-01T10:15:30Z");
searchParams.setToDate("2019-05-01T10:15:30Z");
TransactionSearchParamsValidator.validateSearchParamsForCsv(
searchParams, new CommaDelimitedSetParameter("1,2"));
}

@Test
public void validateSearchParamsForCsvShouldThrowExceptionIfGatewayAccountIsNotAvailable() {
void validateSearchParamsForCsvShouldThrowExceptionIfGatewayAccountIsNotAvailable() {
assertThrows(ValidationException.class, () -> TransactionSearchParamsValidator.validateSearchParamsForCsv(
searchParams, null));
}

@Test
public void validateSearchParamsForCsvShouldThrowExceptionIfGatewayAccountIdsIsEmptyString() {
void validateSearchParamsForCsvShouldThrowExceptionIfGatewayAccountIdsIsEmptyString() {
assertThrows(ValidationException.class, () -> TransactionSearchParamsValidator.validateSearchParamsForCsv(
searchParams, new CommaDelimitedSetParameter("")));
}
Expand All @@ -92,7 +92,7 @@ public void validateSearchParamsForCsvShouldThrowExceptionIfGatewayAccountIdsIsE
"wrong-date, 2019-05-01T10:15:30Z",
"2019-05-01T10:15:30Z, wrong-date"
})
public void validateSearchParamsForCsvShouldThrowExceptionForInvalidDates(String fromDate, String toDate) {
void validateSearchParamsForCsvShouldThrowExceptionForInvalidDates(String fromDate, String toDate) {
searchParams.setFromDate(fromDate);
searchParams.setToDate(toDate);

Expand All @@ -101,15 +101,15 @@ public void validateSearchParamsForCsvShouldThrowExceptionForInvalidDates(String
}

@Test
public void validateFromSettledDateSearchParamsShouldThrowExceptionForInvalidDates() {
void validateFromSettledDateSearchParamsShouldThrowExceptionForInvalidDates() {
searchParams.setFromSettledDate("25/09/2020");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
assertThat(unparsableDateException.getMessage(), is("Input from_settled_date (25/09/2020) is wrong format"));
}

@Test
public void validateToSettledDateSearchParamsShouldThrowExceptionForInvalidDates() {
void validateToSettledDateSearchParamsShouldThrowExceptionForInvalidDates() {
searchParams.setToSettledDate("2020.09.25");
UnparsableDateException unparsableDateException = assertThrows(UnparsableDateException.class,
() -> TransactionSearchParamsValidator.validateSearchParams(searchParams, null));
Expand Down

0 comments on commit c65245a

Please sign in to comment.