Search in sources :

Example 11 with Document

use of org.molgenis.data.elasticsearch.generator.model.Document in project molgenis by molgenis.

the class DocumentContentBuilderTest method createDocumentDecimal.

@Test(dataProvider = "createDocumentDecimal")
public void createDocumentDecimal(Double value, String expectedContent) {
    String attrIdentifier = "attr";
    Entity entity = createEntity(attrIdentifier, AttributeType.DECIMAL);
    when(entity.getDouble(attrIdentifier)).thenReturn(value);
    Document document = documentContentBuilder.createDocument(entity);
    assertDocumentEquals(document, expectedContent);
}
Also used : Entity(org.molgenis.data.Entity) Document(org.molgenis.data.elasticsearch.generator.model.Document) Test(org.testng.annotations.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Aggregations

Document (org.molgenis.data.elasticsearch.generator.model.Document)11 AbstractMockitoTest (org.molgenis.test.AbstractMockitoTest)11 Test (org.testng.annotations.Test)11 Entity (org.molgenis.data.Entity)10