AdapterWrapper { boolean isReady(@NonNull Context context) { try { return adapter.isReady(context) && coordinator.isReady(); } catch (Exception e) { Logger.error(e, "AdapterWrapper - Exception during isReady(Activity)."); return false; } } AdapterWrapper(@NonNull String scheduleId,
                   @NonNull InAppMessage message,
                   @NonNull InAppMessageAdapter adapter,
                   @NonNull DisplayCoordinator coordinator);  final String scheduleId; final InAppMessage message; final InAppMessageAdapter adapter; final DisplayCoordinator coordinator; public boolean displayed; }
@Test public void testIsReady() { assertFalse(adapterWrapper.isReady(context)); when(mockAdapter.isReady(context)).thenReturn(true); assertFalse(adapterWrapper.isReady(context)); when(mockCoordinator.isReady()).thenReturn(true); assertTrue(adapterWrapper.isReady(context)); when(mockAdapter.isReady(context)).thenReturn(false); assertFalse(adapterWrapper.isReady(context)); }
@Test public void testIsReadyAdapterException() { when(mockAdapter.isReady(context)).thenThrow(new RuntimeException("neat")); assertFalse(adapterWrapper.isReady(context)); }
@Test public void testIsReadyCoordinatorException() { when(mockCoordinator.isReady()).thenThrow(new RuntimeException("neat")); assertFalse(adapterWrapper.isReady(context)); }