Skip to content

.withoutCallback should always be stubbed in testing #21

@Pacane

Description

@Pacane

Should change DelegateMocking to this:

    public DelegateMocking<R> useResource(R resource) {
        assert this.resource == null
                : "useResource(R) called more than once. Did you forget to call DelegateTestUtils.init()?";

        this.resource = resource;
        callbackCaptor = ArgumentCaptor.forClass(AsyncCallback.class);
        delegatingDispatchRequestCaptor = ArgumentCaptor.forClass(DelegatingDispatchRequest.class);

        when(delegate.withCallback(callbackCaptor.capture())).thenReturn(resource);
        when(delegate.withoutCallback(callbackCaptor.capture())).thenReturn(resource);
        when(delegate.withDelegatingDispatchRequest(delegatingDispatchRequestCaptor.capture())).thenReturn(delegate);

        return this;
    }

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