use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class JDBCSinkTest method emptyValueList.
@Test
public void emptyValueList() {
String columns = JDBCSink.valueList(new Row());
assertNull(columns);
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class JDBCSinkTest method generateInsertStatement.
@Test
public void generateInsertStatement() {
String expected = "INSERT INTO TARGET_TABLE (a,b) VALUES ('java','tengah')";
Row row = getEntries();
String actual = this.cut.generateInsertStatement(row);
assertThat(actual, is(expected));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class PojoSinkTest method stringMapping.
@Test
public void stringMapping() {
final String expected = "duke";
Row row = new Row();
row.addColumn(-1, "name", expected);
this.cut.processRow(row);
Developer dev = getDeveloper();
String actual = dev.getName();
assertThat(actual, is(expected));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class PojoSinkTest method intMapping.
@Test
public void intMapping() {
final int expected = 42;
Row row = new Row();
row.addColumn(-1, "age", expected);
this.cut.processRow(row);
Developer dev = getDeveloper();
int actual = dev.getAge();
assertThat(actual, is(expected));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class PojoSinkTest method notExistingFieldWithDevNull.
@Test
public void notExistingFieldWithDevNull() {
Consumer<Map<String, Object>> devNull = Mockito.mock(Consumer.class);
PojoSink pojoSink = new PojoSink(Developer.class, this.cachingConsumer, devNull);
final double expected = 1.5;
Row row = new Row();
row.addColumn(-1, "SHOULD-NOT-EXIST", expected);
pojoSink.processRow(row);
verify(devNull).accept(Matchers.anyObject());
}
Aggregations