Search in sources :

Example 1 with EntityTypeFactory

use of org.molgenis.data.meta.model.EntityTypeFactory in project molgenis by molgenis.

the class VcfRepositoryTest method testGetEntityType.

// Regression test for https://github.com/molgenis/molgenis/issues/6528
@Test(expectedExceptions = MolgenisDataException.class, expectedExceptionsMessageRegExp = "Failed to read VCF Metadata from file; nested exception is java.io.IOException: error processing source")
public void testGetEntityType() throws IOException {
    VcfReaderFactory vcfReaderFactory = mock(VcfReaderFactory.class);
    VcfReader vcfReader = mock(VcfReader.class);
    doThrow(new IOException("error processing source")).when(vcfReader).getVcfMeta();
    when(vcfReaderFactory.get()).thenReturn(vcfReader);
    String entityTypeId = "entityTypeId";
    VcfAttributes vcfAttributes = mock(VcfAttributes.class);
    EntityTypeFactory entityTypeFactory = mock(EntityTypeFactory.class);
    AttributeFactory attrMetaFactory = mock(AttributeFactory.class);
    VcfRepository vcfRepository = new VcfRepository(vcfReaderFactory, entityTypeId, vcfAttributes, entityTypeFactory, attrMetaFactory);
    vcfRepository.getEntityType();
}
Also used : EntityTypeFactory(org.molgenis.data.meta.model.EntityTypeFactory) VcfAttributes(org.molgenis.data.vcf.model.VcfAttributes) AttributeFactory(org.molgenis.data.meta.model.AttributeFactory) VcfReader(org.molgenis.vcf.VcfReader) IOException(java.io.IOException) Test(org.testng.annotations.Test) AbstractMolgenisSpringTest(org.molgenis.data.AbstractMolgenisSpringTest)

Aggregations

IOException (java.io.IOException)1 AbstractMolgenisSpringTest (org.molgenis.data.AbstractMolgenisSpringTest)1 AttributeFactory (org.molgenis.data.meta.model.AttributeFactory)1 EntityTypeFactory (org.molgenis.data.meta.model.EntityTypeFactory)1 VcfAttributes (org.molgenis.data.vcf.model.VcfAttributes)1 VcfReader (org.molgenis.vcf.VcfReader)1 Test (org.testng.annotations.Test)1