use of org.androidannotations.api.view.OnViewChangedNotifier in project androidannotations by androidannotations.
the class InheritanceTest method afterViewsMotherCallsFirst.
@Test
public void afterViewsMotherCallsFirst() {
OnViewChangedNotifier notifier = new OnViewChangedNotifier();
OnViewChangedNotifier.replaceNotifier(notifier);
Child_ child = Child_.getInstance_(mock(Activity.class));
notifier.notifyViewChanged(mock(HasViews.class));
assertThat(child.motherInitViewsWasCalled).isTrue();
}
use of org.androidannotations.api.view.OnViewChangedNotifier in project androidannotations by androidannotations.
the class SomeSingletonTest method viewsAreNotInjected.
@Test
public void viewsAreNotInjected() throws Exception {
Context context = mock(Context.class);
OnViewChangedNotifier notifier = new OnViewChangedNotifier();
OnViewChangedNotifier.replaceNotifier(notifier);
SomeSingleton singleton = SomeSingleton_.getInstance_(context);
notifier.notifyViewChanged(new HasViews() {
@Override
public View findViewById(int id) {
return mock(View.class);
}
});
assertThat(singleton.myTextView).isNull();
assertThat(singleton.beanWithView.myTextView).isNull();
}