Skip to content

Commit

Permalink
test: fix tablesuppressbuilder test
Browse files Browse the repository at this point in the history
  • Loading branch information
nae701 committed Aug 9, 2020
1 parent 59439c3 commit 88eeba0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -30,7 +30,6 @@
import java.util.Set;
import java.util.function.BiFunction;


import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.common.utils.Bytes;
import org.apache.kafka.streams.kstream.KTable;
Expand Down
Expand Up @@ -63,6 +63,8 @@ public class TableSuppressBuilderTest {
@Mock
private KsqlQueryBuilder queryBuilder;
@Mock
private KsqlConfig ksqlConfig;
@Mock
private ExecutionStep<KTableHolder<Struct>> sourceStep;
@Mock
private KTable<Struct, GenericRow> sourceKTable;
Expand Down Expand Up @@ -94,9 +96,11 @@ public class TableSuppressBuilderTest {
private final QueryContext queryContext = new QueryContext.Stacker()
.push("bar")
.getQueryContext();

private TableSuppress<Struct> tableSuppress;
private BiFunction<LogicalSchema, Set<SerdeOption>, PhysicalSchema> physicalSchemaFactory;
private BiFunction<Serde<Struct>, Serde<GenericRow>, Materialized> materializedFactory;
private Long maxBytes = 300L;
private TableSuppressBuilder builder;

@Rule
Expand All @@ -112,6 +116,9 @@ public void init() {

when(queryBuilder.buildValueSerde(any(), any(), any())).thenReturn(valueSerde);
when(keySerdeFactory.buildKeySerde(any(), any(), any())).thenReturn(keySerde);
when(queryBuilder.getKsqlConfig()).thenReturn(ksqlConfig);
when(ksqlConfig.getLong(any())).thenReturn(maxBytes);

when(tableHolder.getTable()).thenReturn(sourceKTable);
when(sourceKTable.transformValues(any(), any(Materialized.class))).thenReturn(preKTable);
when(preKTable.suppress(any())).thenReturn(suppressedKTable);
Expand Down

0 comments on commit 88eeba0

Please sign in to comment.