Skip to content

SubscriberBuilderVerification implicitly expects all SubscriberBuilder.build to return an instance of CompletionSubscriber.of #141

@akarnokd

Description

@akarnokd

CompletionSubscriber is a Subscriber and offers a getCompletion method. It is expected to be returned from SubscriberBuilder.build. In addition, CompletionSubscriber has an of method to create an instance of it via composing it. The documentation also states

The best way to instantiate one of these is using the {@link CompletionSubscriber#of} factory method.

However, the SubscriberBuilderVerification.build() test expects the SubscriberBuilder.build() method to return an DefaultCompletionSubscriber effectively, not any arbitrary custom implementation of a CompletionSubscriber. The reason for this is that there is an equals assertion and there is no way to get to the DefaultCompletionSubscriber's wrapped Subscriber from the outside.

Essentially, in order to pass the TCK, implementors have to use CompletionSubscriber.of which makes having it as an interface pointless.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions