Hi,
currently we are evaluating a migration from 0.6.0 to current. We
encountered the following problem, which we currently not sure, how to best
solve.
Say we have a DoFn, which is using Aggregators, e.g.
ctr = createAggregator("someCounter", Sum.ofLongs());
We were testing them with DoFn-Tester like
final DoFnTester<Record, Record> doFnTester =
DoFnTester.of(fixture);
doFnTester.processElement(input);
assertThat(doFnTester.getAggregatorValue(fixture.ctr).longValue(),
is(1L));
As aggregators are removed now from the codebase, we are considering using
Metrics instead. But we did not find an equivalent to the
getAggregatorValue method on DoFnTester.
Any suggestion how we could keep our counters tested within a unit test
based on DoFnTester? Or do we have to find a completely different solution?
Are we doing something completely wrong trying to test correct workings of
our counters with this approach?
Regards,
michel