Skip to content

Consider Unified Builder Test Helper #93

@vjkoskela

Description

@vjkoskela

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions