类org.junit.jupiter.params.provider.NullAndEmptySource源码实例Demo

下面列出了怎么用org.junit.jupiter.params.provider.NullAndEmptySource的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: vividus   文件: RadioButtonStepsTests.java
@ParameterizedTest
@NullAndEmptySource
void testIfRadioOptionExistsEmptyOrNullForAttribute(String forAttribute)
{
    mockRadioOptionLabelSearch(webElement);
    when(webElement.getAttribute(FOR)).thenReturn(forAttribute);
    radioButtonSteps.assertIfRadioOptionExists(RADIO_OPTION);
    verify(baseValidations).assertIfElementExists(RADIO_BUTTON, webElement,
            new SearchAttributes(ActionAttributeType.XPATH, "input[@type='radio']"));
}
 
@ParameterizedTest
@NullAndEmptySource
@ValueSource(strings = {" "})
void fetchCachedResourceId_WithBlankKey_ShouldMakeNoRequestAndReturnEmptyOptional(final String key) {
    //test
    final Optional<String> result = service.getIdFromCacheOrFetch(key).toCompletableFuture().join();

    //assertions
    assertThat(result).isEmpty();
    verify(client, never()).execute(any());
}
 
@ParameterizedTest
@NullAndEmptySource
@ValueSource(strings = {" "})
void fetchResource_WithBlankKey_ShouldMakeNoRequestAndReturnEmptyOptional(final String key) {
    //test
    final Optional<Product> optional = service.fetchProduct(key).toCompletableFuture().join();

    //assertions
    assertThat(optional).isEmpty();
    verify(client, never()).execute(any());
}
 
源代码4 项目: sputnik   文件: ReviewInputBuilderTest.java
@ParameterizedTest
@NullAndEmptySource
void shouldNotSetEmptyOrNullTag(String tag) {
    Configuration config = ConfigurationBuilder.initFromResource("test.properties");
    Review review = ReviewBuilder.buildReview(config);

    ReviewInput reviewInput = reviewInputBuilder.toReviewInput(review, tag);

    assertThat(reviewInput.tag).isNull();
}
 
源代码5 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void oneDimentionIntArrayArgument(int[] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
源代码6 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void twoDimentionsIntArrayArgument(int[][] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
源代码7 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void threeDimentionsIntArrayArgument(int[][][] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
源代码8 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void oneDimensionStringArrayArgument(String[] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
源代码9 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void twoDimensionsStringArrayArgument(String[][] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
源代码10 项目: quarkus   文件: ParameterizedArrayTestCase.java
@ParameterizedTest
@NullAndEmptySource
public void threeDimensionsStringArrayArgument(String[][][] arg) {
    // the test only verifies that the test method is invoked successfully
}
 
 类所在包
 同包方法