File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
workflow-core/src/main/java/com/squareup/workflow
workflow-testing/src/test/java/com/squareup/workflow Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ interface Worker<out OutputT> {
213
213
/* *
214
214
* Returns a [Worker] that finishes immediately without emitting anything.
215
215
*/
216
- fun finished (): Worker <Nothing > = FinishedWorker
216
+ fun < T > finished (): Worker <T > = FinishedWorker
217
217
218
218
/* *
219
219
* Creates a [Worker] from a function that returns a single value.
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ class WorkerTest {
234
234
}
235
235
236
236
@Test fun `finished worker is equivalent to self` () {
237
- assertTrue(Worker .finished().doesSameWorkAs(Worker .finished()))
237
+ assertTrue(Worker .finished< Nothing > ().doesSameWorkAs(Worker .finished< Nothing > ()))
238
238
}
239
239
240
240
@Test fun `transformed workers are equivalent with equivalent source` () {
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ class RealRenderTesterTest {
189
189
initialState = Unit ,
190
190
render = {
191
191
// Need to satisfy the expectation.
192
- runningWorker(Worker .finished() as Worker <Unit >) { noAction() }
192
+ runningWorker(Worker .finished<Unit >() ) { noAction() }
193
193
return @stateful actionSink.contraMap { it }
194
194
}
195
195
)
@@ -571,7 +571,7 @@ class RealRenderTesterTest {
571
571
}
572
572
573
573
@Test fun `verifyAction verifies worker output` () {
574
- val worker: Worker < String > = Worker .finished()
574
+ val worker = Worker .finished< String > ()
575
575
val workflow = Workflow .stateless<Unit , Nothing , Unit > {
576
576
runningWorker(worker) { TestAction (it) }
577
577
}
You can’t perform that action at this time.
0 commit comments