danielgmyers / flux-swf-client

Apache License 2.0
8 stars 3 forks source link

SDK upgrade will require unit test fix #116

Closed danielgmyers closed 1 month ago

danielgmyers commented 1 month ago

FluxCapacitorTest.java will start failing when we update to the latest SDK; at some point the SDK started populating request override fields as part of the auto-paginator functionality we're using, which makes EasyMock fail a handful of unit tests because the request objects actually passed to the SWF client don't look as expected.

We'll need a matcher like this:

    static <T extends SdkPojo> T sdkFieldMatcher(T request) {
        EasyMock.reportMatcher(new IArgumentMatcher() {
            @Override
            public boolean matches(Object o) {
                return request.equalsBySdkFields(o);
            }

            @Override
            public void appendTo(StringBuffer stringBuffer) {
                stringBuffer.append("request{" + request + "}");
            }
        });
        return request;
    }

Then, expectDescribeWorkflows and expectDescribeActivites need to use that matcher when expecting a call to listWorkflowTypes and listActivityTypes, respectively.