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

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(116)

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

IterableAssert.containsExactlyInAnyOrderElementsOf介绍

暂无

代码示例

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

@Test
public void createTablesWithDifferentCapitalizationCreatesInCassandraAndDoesNotUpdateMetadata() {
  createTablesIgnoringException();
  assertThat(kvs.getAllTableNames()).containsExactlyInAnyOrderElementsOf(TABLES);
  assertThat(kvs.getMetadataForTables()).isEmpty();
}

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

@Test
public void setupCreatesAndResetsExistingTables() {
  fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES);
  toKvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
  toKvs.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1), 1);
  assertThat(toKvs.get(TEST_TABLE, ImmutableMap.of(TEST_CELL, Long.MAX_VALUE))).isNotEmpty();
  KeyValueServiceMigrator migrator = KeyValueServiceMigrators.setupMigrator(migratorSpec);
  migrator.setup();
  assertThat(toKvs.getAllTableNames()).containsExactlyInAnyOrderElementsOf(fromKvs.getAllTableNames());
  assertThat(toKvs.get(TEST_TABLE, ImmutableMap.of(TEST_CELL, Long.MAX_VALUE))).isEmpty();
}

代码示例来源:origin: de.bwaldvogel/mongo-java-server-test-common

@Test
public void testListCollections() throws Exception {
  List<String> collections = Arrays.asList("coll1", "coll2", "coll3");
  for (String collection : collections) {
    getCollection(collection).insertOne(json("_id: 1"));
  }
  Document result = db.runCommand(json("listCollections: 1"));
  assertThat(result.getDouble("ok")).isEqualTo(1.0);
  Document cursor = (Document) result.get("cursor");
  assertThat(cursor.keySet()).containsExactly("id", "ns", "firstBatch");
  assertThat(cursor.get("id")).isEqualTo(Long.valueOf(0));
  assertThat(cursor.get("ns")).isEqualTo(db.getName() + ".$cmd.listCollections");
  assertThat(cursor.get("firstBatch")).isInstanceOf(List.class);
  @SuppressWarnings("unchecked")
  List<Document> firstBatch = (List<Document>) cursor.get("firstBatch");
  assertThat(firstBatch).hasSameSizeAs(collections);
  Set<String> collectionNames = new HashSet<>();
  for (Document collection : firstBatch) {
    assertThat(collection.keySet()).containsExactlyInAnyOrder("name", "options", "type", "idIndex", "info");
    String name = (String) collection.get("name");
    assertThat(collection.get("options")).isEqualTo(json(""));
    assertThat(collection.get("name")).isInstanceOf(String.class);
    assertThat(collection.get("type")).isEqualTo("collection");
    assertThat(collection.get("idIndex")).isEqualTo(json("key: {_id: 1}, name: '_id_', ns: 'testdb." + name + "', v: 2"));
    assertThat(collection.get("info")).isInstanceOf(Document.class);
    collectionNames.add(name);
  }
  assertThat(collectionNames).containsExactlyInAnyOrderElementsOf(collections);
}

代码示例来源:origin: FundRequest/platform

@Test
public void findAllTechnologies() throws Exception {
  Request request = RequestMother.freeCodeCampNoUserStories().build();
  Request request2 = RequestMother.fundRequestArea51().build();
  List<Request> entities = Arrays.asList(request, request2);
  requestRepository.save(entities);
  Set<String> expected = entities.stream().map(Request::getTechnologies).flatMap(Collection::stream)
                  .collect(Collectors.toSet());
  Set<String> allTechnologies = requestRepository.findAllTechnologies();
  assertThat(allTechnologies)
      .containsExactlyInAnyOrderElementsOf(expected);
}

代码示例来源:origin: PegaSysEng/pantheon

@Test
public void getFiltersShouldReturnAllFilters() {
 final BlockFilter filter1 = new BlockFilter("foo");
 final BlockFilter filter2 = new BlockFilter("bar");
 repository.save(filter1);
 repository.save(filter2);
 final Collection<Filter> filters = repository.getFilters();
 assertThat(filters).containsExactlyInAnyOrderElementsOf(Lists.newArrayList(filter1, filter2));
}

代码示例来源:origin: SpectoLabs/hoverfly-java

@Test
public void shouldCombineAndImportMultipleSimulationSources() throws Exception {
  startDefaultHoverfly();
  // When
  Simulation simulation1 = mapper.readValue(Resources.getResource("test-service.json"), Simulation.class);
  Simulation simulation2 = mapper.readValue(Resources.getResource("test-service-https.json"), Simulation.class);
  hoverfly.simulate(classpath("test-service.json"), classpath("test-service-https.json"));
  // Then
  Simulation exportedSimulation = hoverfly.getSimulation();
  Sets.SetView<RequestResponsePair> expectedData = Sets.union(simulation1.getHoverflyData().getPairs(), simulation2.getHoverflyData().getPairs());
  List<DelaySettings> expectedDelaySettings = new ArrayList<>();
  expectedDelaySettings.addAll(simulation1.getHoverflyData().getGlobalActions().getDelays());
  expectedDelaySettings.addAll(simulation2.getHoverflyData().getGlobalActions().getDelays());
  assertThat(exportedSimulation.getHoverflyData().getPairs()).containsExactlyInAnyOrderElementsOf(expectedData);
  assertThat(exportedSimulation.getHoverflyData().getGlobalActions().getDelays()).containsExactlyInAnyOrderElementsOf(expectedDelaySettings);
}

代码示例来源:origin: PegaSysEng/pantheon

@Test
public void getFilterCollectionShouldReturnAllFiltersOfSpecificType() {
 final BlockFilter blockFilter1 = new BlockFilter("foo");
 final BlockFilter blockFilter2 = new BlockFilter("biz");
 final PendingTransactionFilter pendingTxFilter1 = new PendingTransactionFilter("bar");
 final Collection<BlockFilter> expectedFilters = Lists.newArrayList(blockFilter1, blockFilter2);
 repository.save(blockFilter1);
 repository.save(blockFilter2);
 repository.save(pendingTxFilter1);
 final Collection<BlockFilter> blockFilters = repository.getFiltersOfType(BlockFilter.class);
 assertThat(blockFilters).containsExactlyInAnyOrderElementsOf(expectedFilters);
}

相关文章

微信公众号

最新文章

更多