Search in sources :

Example 1 with Pipeline

use of com.airhacks.enhydrator.flexpipe.Pipeline in project enhydrator by AdamBien.

the class PumpIT method usePipelineWithSink.

@Test
public void usePipelineWithSink() {
    CoffeeTestFixture.insertCoffee("arabica", 2, "hawai", Roast.LIGHT, "nice", "whole");
    CoffeeTestFixture.insertCoffee("niceone", 3, "russia", Roast.MEDIUM, "awful", "java beans");
    Pipeline pipeline = PipelineTest.getJDBCPipeline();
    Pump pump = new Pump.Engine().flowListener(l -> System.out.println(l)).use(pipeline).build();
    pump.start();
}
Also used : Pipeline(com.airhacks.enhydrator.flexpipe.Pipeline) PipelineTest(com.airhacks.enhydrator.flexpipe.PipelineTest) Test(org.junit.Test)

Example 2 with Pipeline

use of com.airhacks.enhydrator.flexpipe.Pipeline in project enhydrator by AdamBien.

the class PumpIT method usePipeline.

@Test
public void usePipeline() {
    Pipeline pipeline = PipelineTest.getCSVPipeline();
    NamedSink consumer = getMockedSink();
    Pump pump = new Pump.Engine().flowListener(l -> System.out.println(l)).use(pipeline).to(consumer).build();
    pump.start();
    verify(consumer, times(4)).processRow(any(Row.class));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) PipelineTest(com.airhacks.enhydrator.flexpipe.PipelineTest) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Mockito.verify(org.mockito.Mockito.verify) Assert.assertThat(org.junit.Assert.assertThat) Matchers.any(org.mockito.Matchers.any) List(java.util.List) Mockito.never(org.mockito.Mockito.never) JDBCSource(com.airhacks.enhydrator.in.JDBCSource) After(org.junit.After) NamedSink(com.airhacks.enhydrator.out.NamedSink) Pipeline(com.airhacks.enhydrator.flexpipe.Pipeline) Row(com.airhacks.enhydrator.in.Row) Before(org.junit.Before) Mockito.mock(org.mockito.Mockito.mock) NamedSink(com.airhacks.enhydrator.out.NamedSink) Row(com.airhacks.enhydrator.in.Row) Pipeline(com.airhacks.enhydrator.flexpipe.Pipeline) PipelineTest(com.airhacks.enhydrator.flexpipe.PipelineTest) Test(org.junit.Test)

Aggregations

Pipeline (com.airhacks.enhydrator.flexpipe.Pipeline)2 PipelineTest (com.airhacks.enhydrator.flexpipe.PipelineTest)2 Test (org.junit.Test)2 JDBCSource (com.airhacks.enhydrator.in.JDBCSource)1 Row (com.airhacks.enhydrator.in.Row)1 NamedSink (com.airhacks.enhydrator.out.NamedSink)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Function (java.util.function.Function)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 After (org.junit.After)1 Assert.assertThat (org.junit.Assert.assertThat)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 Before (org.junit.Before)1 Matchers.any (org.mockito.Matchers.any)1 Mockito.mock (org.mockito.Mockito.mock)1 Mockito.never (org.mockito.Mockito.never)1 Mockito.times (org.mockito.Mockito.times)1 Mockito.verify (org.mockito.Mockito.verify)1 Mockito.when (org.mockito.Mockito.when)1