Create a super interface for each of the event types
See original GitHub issueI was trying to test code that depends on ChannelMessageEvent
tonight and there was no easy way to fake ChannelMessageEvent
without extending the concrete class. My code depends on several of the interfaces it implements, but because there is no super interface that pulls them together for ChannelMessageEvent
to implement I’m extending.
I’d like to see all of the event classes roll up the interfaces they implement into one super interface, one for each of the event types so future testing isn’t so hacky.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
EventType (Apache Commons Configuration 2.8.0 API)
Returns a set with all event types that are super types of the specified type. This set contains the direct and indirect super...
Read more >Java Tip 35: Create new event types in Java - InfoWorld
In the case of the wizard panel, a listener should support four different event cases, one for each button. I start by creating...
Read more >EventType (JavaFX 8) - Oracle Help Center
This class represents a specific event type associated with an Event . Event types form a hierarchy with the ROOT (equals to Event.ANY...
Read more >java - subinterface overriding superinterfaces method
So I have an abstract class Event from which the user can create subclasses as his own event types. The listeners, which the...
Read more >The Eventuate client framework for Java and Spring
The client framework provides the following types for defining event classes: Event interface - a super interface for events; @EventEntity annotation - an ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are right that I don’t have checker framework as a dependency because I’m not using directly. If that’s the solution I still submit something about the module implementation is broken.
If your answer is that I have to use a tool like Mockito or extend your code to add testing behavior to write tests against your code that’s fine. I would just like to not depend on concrete implementations if I don’t have to thus the issue being opened.
To be clear, make Mockito work was not the goal of my issue. Mockito breaking certainly put things on my radar, but at the end of the day, to use this library requires directly depending on concrete implementations and not interfaces. This will always have an adverse impact on testability.