Search in sources :

Example 16 with ValidationResult

use of com.redhat.service.smartevents.infra.validations.ValidationResult in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class WebhookActionValidatorTest method isInvalid.

@ParameterizedTest
@MethodSource("invalidParams")
void isInvalid(Map<String, String> params, String expectedErrorMessage) {
    ValidationResult validationResult = validator.isValid(actionWith(params));
    assertThat(validationResult.isValid()).isFalse();
    assertThat(validationResult.getMessage()).startsWith(expectedErrorMessage);
}
Also used : ValidationResult(com.redhat.service.smartevents.infra.validations.ValidationResult) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 17 with ValidationResult

use of com.redhat.service.smartevents.infra.validations.ValidationResult in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class AwsSqsSourceValidatorTest method isInvalid.

@ParameterizedTest
@MethodSource("invalidParams")
void isInvalid(Map<String, String> params, String expectedErrorMessage) {
    ValidationResult validationResult = validator.isValid(sourceWith(params));
    assertThat(validationResult.isValid()).isFalse();
    assertThat(validationResult.getMessage()).isEqualTo(expectedErrorMessage);
}
Also used : ValidationResult(com.redhat.service.smartevents.infra.validations.ValidationResult) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

ValidationResult (com.redhat.service.smartevents.infra.validations.ValidationResult)17 Test (org.junit.jupiter.api.Test)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 MethodSource (org.junit.jupiter.params.provider.MethodSource)4 Action (com.redhat.service.smartevents.infra.models.gateways.Action)3 QuarkusTest (io.quarkus.test.junit.QuarkusTest)3 GatewayProviderException (com.redhat.service.smartevents.infra.exceptions.definitions.user.GatewayProviderException)1 HibernateConstraintValidatorContext (org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext)1