public class IsEventFrom extends TypeSafeDiagnosingMatcher<EventObject>
Constructor and Description |
---|
IsEventFrom(Class<?> eventClass,
Object source) |
Modifier and Type | Method and Description |
---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
static Matcher<EventObject> |
eventFrom(Class<? extends EventObject> eventClass,
Object source)
Creates a matcher of
EventObject that matches any object
derived from eventClass announced by source. |
static Matcher<EventObject> |
eventFrom(Object source)
Creates a matcher of
EventObject that matches any EventObject
announced by source. |
boolean |
matchesSafely(EventObject item,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
public boolean matchesSafely(EventObject item, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<EventObject>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static Matcher<EventObject> eventFrom(Class<? extends EventObject> eventClass, Object source)
EventObject
that matches any object
derived from eventClass announced by source.
For example:
assertThat(myEvent, is(eventFrom(PropertyChangeEvent.class, myBean)))
eventClass
- the class of the event to match onsource
- the source of the eventpublic static Matcher<EventObject> eventFrom(Object source)
EventObject
that matches any EventObject
announced by source.
For example:
assertThat(myEvent, is(eventFrom(myBean)))
source
- the source of the eventCopyright © 2020. All rights reserved.