Created
June 21, 2023 20:09
-
-
Save eliasnogueira/21ca0f6c083ced16959a2c890806c8af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MethodSourceCase2ExampleTest { | |
@DisplayName("Payment status") | |
@ParameterizedTest(name = "The payment with status {0} returns the message {1}") | |
@MethodSource("statusList") | |
void paymentStatus(Status status, String message) { | |
String auditedPayment = auditService.getPayments(status); | |
assertThat(status).isEqualTo(message); | |
} | |
static Stream<Arguments> statusList() { | |
return Stream.of( | |
Arguments.arguments(STATUS_PROCESSING, "The payment is being processed."), | |
Arguments.arguments(STATUS_PENDING, "The payment is pending."), | |
Arguments.arguments(STATUS_APPROVED, "The payment is approved."), | |
Arguments.arguments(STATUS_FAILED, "The payment failed.") | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment