Search in sources :

Example 76 with Collection

use of io.lumeer.api.model.Collection in project engine by Lumeer.

the class ImportFacadeIT method testImportEmptyCSV.

@Test
public void testImportEmptyCSV() {
    final String emptyCSV = "";
    ImportedCollection importedCollection = createImportObject(emptyCSV);
    Collection collection = importFacade.importDocuments(ImportFacade.FORMAT_CSV, importedCollection);
    assertThat(collection).isNotNull();
    List<DataDocument> data = dataDao.getData(collection.getId(), query());
    assertThat(data).isEmpty();
}
Also used : DataDocument(io.lumeer.engine.api.data.DataDocument) ImportedCollection(io.lumeer.api.model.ImportedCollection) JsonCollection(io.lumeer.api.dto.JsonCollection) ImportedCollection(io.lumeer.api.model.ImportedCollection) Collection(io.lumeer.api.model.Collection) Test(org.junit.Test)

Example 77 with Collection

use of io.lumeer.api.model.Collection in project engine by Lumeer.

the class ImportFacadeIT method testImportCollectionInfo.

@Test
public void testImportCollectionInfo() {
    final String emptyCSV = "";
    ImportedCollection importedCollection = createImportObject(emptyCSV);
    Collection collection = importFacade.importDocuments(ImportFacade.FORMAT_CSV, importedCollection);
    assertThat(collection).isNotNull();
    assertThat(collection.getName()).isEqualTo(COLLECTION_NAME);
    assertThat(collection.getCode()).isEqualTo(COLLECTION_CODE);
    assertThat(collection.getIcon()).isEqualTo(COLLECTION_ICON);
    assertThat(collection.getColor()).isEqualTo(COLLECTION_COLOR);
}
Also used : ImportedCollection(io.lumeer.api.model.ImportedCollection) JsonCollection(io.lumeer.api.dto.JsonCollection) ImportedCollection(io.lumeer.api.model.ImportedCollection) Collection(io.lumeer.api.model.Collection) Test(org.junit.Test)

Aggregations

Collection (io.lumeer.api.model.Collection)77 Test (org.junit.Test)47 JsonCollection (io.lumeer.api.dto.JsonCollection)34 DataDocument (io.lumeer.engine.api.data.DataDocument)17 MorphiaCollection (io.lumeer.storage.mongodb.model.MorphiaCollection)17 SearchQuery (io.lumeer.storage.api.query.SearchQuery)14 SoftAssertions (org.assertj.core.api.SoftAssertions)12 Document (io.lumeer.api.model.Document)8 ImportedCollection (io.lumeer.api.model.ImportedCollection)8 SuggestionQuery (io.lumeer.storage.api.query.SuggestionQuery)8 Response (javax.ws.rs.core.Response)8 JsonAttribute (io.lumeer.api.dto.JsonAttribute)7 Attribute (io.lumeer.api.model.Attribute)7 HashSet (java.util.HashSet)6 JsonQuery (io.lumeer.api.dto.JsonQuery)5 LocalDateTime (java.time.LocalDateTime)4 List (java.util.List)4 JsonDocument (io.lumeer.api.dto.JsonDocument)3 LinkType (io.lumeer.api.model.LinkType)3 CollectionDao (io.lumeer.storage.api.dao.CollectionDao)3