Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize logic for transactional sink tests #79

Open
olukas opened this issue Apr 6, 2020 · 0 comments
Open

Centralize logic for transactional sink tests #79

olukas opened this issue Apr 6, 2020 · 0 comments

Comments

@olukas
Copy link
Contributor

olukas commented Apr 6, 2020

There is some logic which is similar for transactional sink tests (in modules snapshot-file-test, snapshot-jdbc-test and snapshot-jms-sink-test).

  1. Tests for transactional sinks use source as following:
StreamSource<Integer> source = SourceBuilder
        .stream(NAME, procCtx -> new int[1])
        .<Integer>fillBufferFn((ctx, buf) -> {
            buf.add(ctx[0]++);
            sleepMillis(SLEEP);
        })
        .createSnapshotFn(ctx -> ctx[0])
        .restoreSnapshotFn((ctx, state) -> ctx[0] = state.get(0))
        .build();
  1. Verifiers JmsSinkVerifier, GeneratedFilesVerifier and JdbcSinkVerifier use the similar logic.

It should be centralized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant