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

Consider Unified Builder Test Helper #93

Open
vjkoskela opened this issue May 29, 2020 · 0 comments
Open

Consider Unified Builder Test Helper #93

vjkoskela opened this issue May 29, 2020 · 0 comments

Comments

@vjkoskela
Copy link
Member

As per @speezepearson feedback consider a single Builder test helper that performs all builder related tests. If more common testing is added then modifying commons would modify all tests that use that common entry point.

e.g.

public class ThreadLocalBuildableTestHelper {
    public static void testAllInvariants(
        final Class<T> targetObjectType
        final Supplier<ThreadLocalBuilder<T, ?>> builderSupplier
    ) {
            BuildableTestHelper.testBuild(
                    builderSupplier.get(),
                    targetObjectType);

            ThreadLocalBuildableTestHelper.testResetbuilderSupplier.get());

            final String asString = builderSupplier.get().build().toString();
            Assert.assertNotNull(asString);
            Assert.assertFalse(asString.isEmpty());

    }
}

From:
https://github.com/ArpNetworking/metrics-aggregator-daemon/pull/195/files

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

No branches or pull requests

1 participant