@Test
public void testInsertStructuredDataWithIndexDefinitionsWithoutOptions() {

    // GIVEN
    final List<Document> values1 = Arrays.asList(DOCUMENT_1);
    final Document index1 = new Document().append("a", "1");
    final List<Document> indexes1 = Arrays.asList(new Document().append("index", index1));
    final Document doc1 = new Document().append("data", values1).append("indexes", indexes1);
    final List<Document> values2 = Arrays.asList(DOCUMENT_2);
    final Document index2 = new Document().append("c", "1");
    final List<Document> indexes2 = Arrays.asList(new Document().append("index", index2));
    final Document doc2 = new Document().append("data", values2).append("indexes", indexes2);
    final Document data = new Document().append(COLLECTION_NAME_1, doc1).append(COLLECTION_NAME_2, doc2);
    // WHEN
    operation.execute(connection, data);
    // THEN
    verify(connection, times(4)).getCollection(collectionNameCaptor.capture());
    final Collection<String> capturedCollectionNames = new HashSet<>(collectionNameCaptor.getAllValues());
    assertThat(capturedCollectionNames.size(), equalTo(2));
    assertThat(capturedCollectionNames, hasItems(COLLECTION_NAME_1, COLLECTION_NAME_2));
    final ArgumentCaptor<Document> indexCaptor = ArgumentCaptor.forClass(Document.class);
    verify(collection, times(2)).createIndex(indexCaptor.capture());
    final List<Document> capturedIndexes = indexCaptor.getAllValues();
    assertThat(capturedIndexes.size(), equalTo(2));
    assertThat(capturedIndexes, hasItems(index1, index2));
    verify(collection, times(2)).insertMany(documentCaptor.capture());
    final List<List<Document>> capturedDocuments = documentCaptor.getAllValues();
    assertThat(capturedDocuments.size(), equalTo(2));
    assertThat(capturedDocuments, hasItems(values1, values2));
}