question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a super interface for each of the event types

See original GitHub issue

I 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:open
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mechjacktvcommented, Feb 8, 2019

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.

0reactions
mechjacktvcommented, Feb 10, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found