MCPcopy Create free account
hub / github.com/AndroidKnife/RxBus / StringCatcher

Class StringCatcher

rxbus/src/test/java/com/hwangjr/rxbus/StringCatcher.java:16–31  ·  view source on GitHub ↗

A simple SubscriberEvent mock that records Strings. For testing fun, also includes a landmine method that Bus tests are required not to call (#methodWithoutAnnotation(String)).

Source from the content-addressed store, hash-verified

14 * required <em>not</em> to call ({@link #methodWithoutAnnotation(String)}).
15 */
16public class StringCatcher {
17 private List<String> events = new ArrayList<String>();
18
19 @Subscribe
20 public void hereHaveAString(String string) {
21 events.add(string);
22 }
23
24 public void methodWithoutAnnotation(String string) {
25 Assert.fail("Event bus must not call methods without @Subscribe!");
26 }
27
28 public List<String> getEvents() {
29 return events;
30 }
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected