Search in sources :

Example 1 with StatementExtractorService

use of org.nextprot.api.etl.service.StatementExtractorService in project nextprot-api by calipho-sib.

the class StatementLoadAndRetrievedStatementsOnUnitDBTest method shouldExtractLoadAndRetriveStatements.

@Test
public void shouldExtractLoadAndRetriveStatements() {
    StatementExtractorService extractor = new StatementsExtractorLocalMockImpl();
    Set<Statement> rawStatements = extractor.getStatementsForSourceForGeneNameAndEnvironment(null, "2017-01-13", "msh6-variant-on-iso1-but-not-on-iso2");
    statementETLService.setStatementExtractorService(extractor);
    statementETLService.setStatementTransformerService(transformerMockedService);
    Set<Statement> mappedStatements = ((StatementETLServiceImpl) statementETLService).transformStatements(rawStatements, new ReportBuilder());
    ((StatementETLServiceImpl) statementETLService).loadStatements(rawStatements, mappedStatements, true, new ReportBuilder());
    List<Statement> dbStatements = statementDao.findNormalStatements(AnnotationType.ENTRY, "NX_P52701");
    dbStatements.addAll(statementDao.findProteoformStatements(AnnotationType.ENTRY, "NX_P52701"));
    Assert.assertEquals(dbStatements.size(), mappedStatements.size());
}
Also used : ReportBuilder(org.nextprot.api.etl.service.impl.StatementETLServiceImpl.ReportBuilder) Statement(org.nextprot.commons.statements.Statement) StatementExtractorService(org.nextprot.api.etl.service.StatementExtractorService) Test(org.junit.Test) StatementETLBaseUnitTest(org.nextprot.api.etl.statement.StatementETLBaseUnitTest)

Aggregations

Test (org.junit.Test)1 StatementExtractorService (org.nextprot.api.etl.service.StatementExtractorService)1 ReportBuilder (org.nextprot.api.etl.service.impl.StatementETLServiceImpl.ReportBuilder)1 StatementETLBaseUnitTest (org.nextprot.api.etl.statement.StatementETLBaseUnitTest)1 Statement (org.nextprot.commons.statements.Statement)1