use of org.apache.phoenix.flume.sink.NullPhoenixSink in project phoenix by apache.
the class PhoenixSinkIT method testExtendedSink.
@Test
public void testExtendedSink() throws Exception {
// Create a mock NullPhoenixSink which extends PhoenixSink, and verify configure is invoked()
PhoenixSink sink = mock(NullPhoenixSink.class);
sinkContext = new Context();
sinkContext.put(FlumeConstants.CONFIG_TABLE, "FLUME_TEST_EXTENDED");
sinkContext.put(FlumeConstants.CONFIG_JDBC_URL, getUrl());
sinkContext.put(FlumeConstants.CONFIG_SERIALIZER, CustomSerializer.class.getName());
sinkContext.put(FlumeConstants.CONFIG_SERIALIZER_PREFIX + FlumeConstants.CONFIG_COLUMN_NAMES, "ID, COUNTS");
sinkContext.put(FlumeConstants.CONFIG_SERIALIZER_PREFIX + FlumeConstants.CONFIG_ROWKEY_TYPE_GENERATOR, DefaultKeyGenerator.TIMESTAMP.name());
Configurables.configure(sink, sinkContext);
verify(sink).configure(sinkContext);
}
Aggregations