org.assertj.core.api.ListAssert.doesNotContainAnyElementsOf()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.assertj.core.api.ListAssert.doesNotContainAnyElementsOf()方法的一些代码示例,展示了ListAssert.doesNotContainAnyElementsOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListAssert.doesNotContainAnyElementsOf()方法的具体详情如下:
包路径:org.assertj.core.api.ListAssert
类名称:ListAssert
方法名:doesNotContainAnyElementsOf

ListAssert.doesNotContainAnyElementsOf介绍

暂无

代码示例

代码示例来源:origin: apache/geode

@Test
public void theseLinesShouldRedact() {
 String argumentThatShouldBeRedacted = "__this_should_be_redacted__";
 List<String> someTabooOptions =
   Arrays.asList("-Dgemfire.password=" + argumentThatShouldBeRedacted,
     "--password=" + argumentThatShouldBeRedacted,
     "--J=-Dgemfire.some.very.qualified.item.password=" + argumentThatShouldBeRedacted,
     "--J=-Dsysprop-secret.information=" + argumentThatShouldBeRedacted);
 List<String> fullyRedacted = redactEachInList(someTabooOptions);
 assertThat(fullyRedacted).doesNotContainAnyElementsOf(someTabooOptions);
}

代码示例来源:origin: palantir/atlasdb

List<Long> timestamps = getCellsToSweepFor().sortedTimestamps();
assertThat(timestamps).doesNotContainAnyElementsOf(COMMITTED_AFTER);

代码示例来源:origin: org.kie.server/kie-server-integ-tests-all

private <T> void assertPagination(final PaginatingRecordsProvider<T> paginatingProcessProvider, final int pageSize) {
  final List<T> all = paginatingProcessProvider.apply(0, Integer.MAX_VALUE);
  final int mod = all.size() % pageSize;
  final int lastPageIndex = mod == 0? (all.size() / pageSize) - 1 : all.size() / pageSize;
  final int firstPageExpectedCount = Math.min(all.size(), pageSize);
  final int lastPageExpectedCount = mod == 0 ? pageSize : mod;
  final List<T> firstPage = paginatingProcessProvider.apply(0, pageSize);
  final List<T> lastPage = paginatingProcessProvider.apply(lastPageIndex, pageSize);
  final List<T> nonExistingPage = paginatingProcessProvider.apply(lastPageIndex + 1, pageSize);
  Assertions.assertThat(nonExistingPage).isEmpty();
  Assertions.assertThat(firstPage).hasSize(firstPageExpectedCount).doesNotContainAnyElementsOf(lastPage);
  Assertions.assertThat(lastPage).hasSize(lastPageExpectedCount).doesNotContainAnyElementsOf(firstPage);
  // what if we use negative page number or page size?
  assertClientException(() -> paginatingProcessProvider.apply(-1, pageSize), 400, "-1");
  assertClientException(() -> paginatingProcessProvider.apply(0, -1), 400, "-1");
}

代码示例来源:origin: org.kie.server/kie-server-integ-tests-jbpm

@Test
public void testGetProcessDefinitionsByContainer() throws Exception {
  List<ProcessDefinition> definitions = queryClient.findProcessesByContainerId(CONTAINER_ID, 0, 20);
  assertNotNull(definitions);
  Assertions.assertThat(definitions).hasSize(16);
  List<String> processIds = collectDefinitions(definitions);
  checkProcessDefinitions(processIds);
  // test paging of the result
  List<ProcessDefinition> definitionsFirstPage = queryClient.findProcessesByContainerId(CONTAINER_ID, 0, 5);
  List<String> processIdsFirstPage = collectDefinitions(definitionsFirstPage);
  Assertions.assertThat(processIdsFirstPage).hasSize(5);
  Assertions.assertThat(processIds).containsAll(processIdsFirstPage);
  List<ProcessDefinition> definitionsSecondPage = queryClient.findProcessesByContainerId(CONTAINER_ID, 1, 5);
  List<String> processIdsSecondPage = collectDefinitions(definitionsSecondPage);
  Assertions.assertThat(processIdsSecondPage).hasSize(5);
  Assertions.assertThat(processIds).containsAll(processIdsSecondPage);
  Assertions.assertThat(processIdsSecondPage).doesNotContainAnyElementsOf(processIdsFirstPage);
  // last check if there are process def for not existing project
  List<ProcessDefinition> definitionsNotExistingProject = queryClient.findProcessesByContainerId("not-existing-project", 0, 10);
  Assertions.assertThat(definitionsNotExistingProject).hasSize(0);
}

代码示例来源:origin: org.kie.server/kie-server-integ-tests-jbpm

@Test
public void testGetProcessDefinitions() throws Exception {
  List<ProcessDefinition> definitions = queryClient.findProcesses(0, 20);
  assertNotNull(definitions);
  assertEquals(16, definitions.size());
  List<String> processIds = collectDefinitions(definitions);
  checkProcessDefinitions(processIds);
  // test paging of the result
  List<ProcessDefinition> definitionsFirstPage = queryClient.findProcesses(0, 5);
  List<String> processIdsFirstPage = collectDefinitions(definitionsFirstPage);
  Assertions.assertThat(processIdsFirstPage).hasSize(5);
  Assertions.assertThat(processIds).containsAll(processIdsFirstPage);
  List<ProcessDefinition> definitionsSecondPage = queryClient.findProcesses(1, 5);
  List<String> processIdsSecondPage = collectDefinitions(definitionsSecondPage);
  Assertions.assertThat(processIdsSecondPage).hasSize(5);
  Assertions.assertThat(processIds).containsAll(processIdsSecondPage);
  Assertions.assertThat(processIdsSecondPage).doesNotContainAnyElementsOf(processIdsFirstPage);
}

代码示例来源:origin: commercetools/commercetools-jvm-sdk

private void assertModelsNotPresent() {
    cleanUpByName(modelNames());
    assertThat(getNames(client().executeBlocking(queryRequestForQueryAll()).getResults())).overridingErrorMessage("the instances with the names " + modelNames() + " should not be present.").doesNotContainAnyElementsOf(modelNames());
  }
}

相关文章

微信公众号

最新文章

更多

ListAssert类方法