Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
@RunWith(AndroidJUnit4.class)
public class SleepWorkerTest {
private Context context;
@Before
public void setUp() {
context = ApplicationProvider.getApplicationContext();
}
@Test
public void testSleepWorker() {
SleepWorker worker = TestListenableWorkerBuilder.from(context, SleepWorker.class)
.build();
worker.createWork().subscribe(result ->
assertThat(result, is(Result.success())));
}
}
assertThat not work, result direct return. May be we need a TestObserver to awaitTerminalEvent here.