Search in sources :

Example 1 with ProgressProducerForTests

use of eu.ggnet.dwoss.progress.ProgressProducerForTests in project dwoss by gg-net.

the class ImportPriceManagementLogicTest method testFromXls.

@Test
public void testFromXls() throws UserInfoException {
    PriceCoreOperation core = mock(PriceCoreOperation.class);
    ImporterOperation importer = new ImporterOperation(core, new ProgressProducerForTests());
    FileJacket jacket = new FileJacket("Sample", "xls", new File("target/test-classes/ImportPriceManagementLogicSamples.xls"));
    importer.fromXls(jacket, "testuser");
    List<PriceEngineResult> expected = new ArrayList<>();
    expected.add(new PriceEngineResult("1", "A", 1.0, 1.0, 0, 1, 0));
    expected.add(new PriceEngineResult("2", "A", 2.0, 2.0, 1, 0, 0));
    expected.add(new PriceEngineResult("3", "B", 3.0, 3.0, 0, -1, 0));
    expected.add(new PriceEngineResult("4", "B", 4.0, 4.0, 1, 0, 0));
    expected.add(new PriceEngineResult("5", "C", 5.0, 5.0, 0, 0, 1));
    verify(core).store(eq(expected), eq("ImportPriceManagementOperation.fromXls()"), anyString(), any(IMonitor.class));
}
Also used : PriceEngineResult(eu.ggnet.dwoss.price.engine.PriceEngineResult) PriceCoreOperation(eu.ggnet.dwoss.price.PriceCoreOperation) ProgressProducerForTests(eu.ggnet.dwoss.progress.ProgressProducerForTests) ArrayList(java.util.ArrayList) FileJacket(eu.ggnet.dwoss.util.FileJacket) ImporterOperation(eu.ggnet.dwoss.price.ImporterOperation) File(java.io.File) IMonitor(eu.ggnet.saft.api.progress.IMonitor) Test(org.junit.Test)

Aggregations

ImporterOperation (eu.ggnet.dwoss.price.ImporterOperation)1 PriceCoreOperation (eu.ggnet.dwoss.price.PriceCoreOperation)1 PriceEngineResult (eu.ggnet.dwoss.price.engine.PriceEngineResult)1 ProgressProducerForTests (eu.ggnet.dwoss.progress.ProgressProducerForTests)1 FileJacket (eu.ggnet.dwoss.util.FileJacket)1 IMonitor (eu.ggnet.saft.api.progress.IMonitor)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1