use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project abort-mission by nagyesta.
the class MissionHealthCheckMatcherBuilderTest method testBuilderShouldAllowBuildingOrMatcherWhenCalledWithValidInput.
@Test
void testBuilderShouldAllowBuildingOrMatcherWhenCalledWithValidInput() {
// given
// when
final MissionHealthCheckMatcher actual = MissionHealthCheckMatcherBuilder.builder().or(A_CLASS_MATCHER).orAtLast(A_DEPENDENCY_MATCHER).build();
// then
assertEquals(OR, actual.getMatchCriteria());
assertTrue(actual.getName().contains(OR.name()));
assertTrue(actual.getName().contains(REGEX));
assertTrue(actual.getName().contains(NAME));
}
use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project abort-mission by nagyesta.
the class MissionHealthCheckMatcherBuilderTest method testBuilderShouldAllowBuildingClassMatcherWhenCalledWithValidInput.
@Test
void testBuilderShouldAllowBuildingClassMatcherWhenCalledWithValidInput() {
// given
// when
final MissionHealthCheckMatcher actual = MissionHealthCheckMatcherBuilder.builder().classNamePattern(REGEX).build();
// then
assertEquals(CLASS, actual.getMatchCriteria());
assertTrue(actual.getName().contains(REGEX));
}
use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project abort-mission by nagyesta.
the class MissionHealthCheckMatcherBuilderTest method testBuilderShouldAllowBuildingNotMatcherWhenCalledWithValidInput.
@Test
void testBuilderShouldAllowBuildingNotMatcherWhenCalledWithValidInput() {
// given
// when
final MissionHealthCheckMatcher actual = MissionHealthCheckMatcherBuilder.builder().not(A_CLASS_MATCHER).build();
// then
assertEquals(NOT, actual.getMatchCriteria());
assertTrue(actual.getName().contains(NOT.name()));
}
use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project abort-mission by nagyesta.
the class MissionHealthCheckMatcherBuilderTest method testBuilderShouldAllowBuildingSystemPropertyMatcherWhenCalledWithValidInput.
@Test
void testBuilderShouldAllowBuildingSystemPropertyMatcherWhenCalledWithValidInput() {
// given
// when
final MissionHealthCheckMatcher actual = MissionHealthCheckMatcherBuilder.builder().property(NAME).valuePattern(REGEX).build();
// then
assertEquals(PROPERTY, actual.getMatchCriteria());
assertTrue(actual.getName().contains(NAME));
assertTrue(actual.getName().contains(REGEX));
}
use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project abort-mission by nagyesta.
the class NotMatcherTest method testMatchesShouldThrowExceptionWhenCalledWithUnsupportedInput.
@ParameterizedTest
@NullSource
@MethodSource("unsupportedComponentProvider")
void testMatchesShouldThrowExceptionWhenCalledWithUnsupportedInput(final Object invalidInput) {
// given
final MissionHealthCheckMatcher underTest = MissionHealthCheckMatcherBuilder.builder().not(STRING_MATCHER).build();
// when
final boolean actual = underTest.matches(invalidInput);
// then
assertTrue(actual);
}
Aggregations