@Test public void testHandleResponse() { Action0 onSuccessMock = mock(Action0.class); Action0 onFailMock = mock(Action0.class); OpenSession openSession = OpenSession.newSession(() -> "*1*REQUEST"); openSession.addAllResponse(Lists.newArrayList(() -> "*#*1##")); Observable.just(openSession) .map(Lighting.handleResponse(onSuccessMock, onFailMock)) .subscribe(); verify(onSuccessMock).call(); verify(onFailMock, never()).call(); }
public static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail) { return handleResponse(onSuccess, onFail, WHO); }
Lighting extends BaseOpenMessage { public static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail) { return handleResponse(onSuccess, onFail, WHO); } }
Lighting extends BaseOpenMessage { public static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail) { return handleResponse(onSuccess, onFail, WHO); } private  Lighting(String value); }
Lighting extends BaseOpenMessage { public static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail) { return handleResponse(onSuccess, onFail, WHO); } private  Lighting(String value); static Lighting requestTurnOn(String where); static Lighting requestTurnOn(String where, Type type, String bus); static Lighting requestTurnOff(String where); static Lighting requestTurnOff(String where, Type type, String bus); static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail); static Lighting requestStatus(String where); static Lighting requestStatus(String where, Type type, String bus); static Func1<OpenSession, OpenSession> handleStatus(Action0 onStatus, Action0 offStatus); static boolean isValidRangeType(String where, Type type, String bus); }
Lighting extends BaseOpenMessage { public static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail) { return handleResponse(onSuccess, onFail, WHO); } private  Lighting(String value); static Lighting requestTurnOn(String where); static Lighting requestTurnOn(String where, Type type, String bus); static Lighting requestTurnOff(String where); static Lighting requestTurnOff(String where, Type type, String bus); static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail); static Lighting requestStatus(String where); static Lighting requestStatus(String where, Type type, String bus); static Func1<OpenSession, OpenSession> handleStatus(Action0 onStatus, Action0 offStatus); static boolean isValidRangeType(String where, Type type, String bus);  }