Search in sources :

Example 1 with StringDependencyNameExtractor

use of com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor in project abort-mission by nagyesta.

the class DependencyMatcherTest method testMatchesShouldUseExactMatchWhenCalledWithString.

@ParameterizedTest
@MethodSource("inputProvider")
void testMatchesShouldUseExactMatchWhenCalledWithString(final boolean matches, final String dependency) {
    // given
    final MissionHealthCheckMatcher underTest = MissionHealthCheckMatcherBuilder.builder().dependencyWith(dependency).extractor(new StringDependencyNameExtractor()).build();
    // when
    final boolean actual = underTest.matches(MATCHING_DEPENDENCY);
    // then
    assertEquals(matches, actual);
}
Also used : StringDependencyNameExtractor(com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor) MissionHealthCheckMatcher(com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with StringDependencyNameExtractor

use of com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor in project abort-mission by nagyesta.

the class DependencyMatcherTest method testMatchesShouldThrowExceptionWhenCalledWithUnsupportedInput.

@ParameterizedTest
@NullSource
@MethodSource("unsupportedComponentProvider")
void testMatchesShouldThrowExceptionWhenCalledWithUnsupportedInput(final Object invalidInput) {
    // given
    final MissionHealthCheckMatcher underTest = MissionHealthCheckMatcherBuilder.builder().dependencyWith(MATCHING_DEPENDENCY).extractor(new StringDependencyNameExtractor()).build();
    // when
    final boolean actual = underTest.matches(invalidInput);
    // then
    assertFalse(actual);
}
Also used : StringDependencyNameExtractor(com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor) MissionHealthCheckMatcher(com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource) NullSource(org.junit.jupiter.params.provider.NullSource)

Aggregations

StringDependencyNameExtractor (com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor)2 MissionHealthCheckMatcher (com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 NullSource (org.junit.jupiter.params.provider.NullSource)1