This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("FetcherTwo") { | |
lateinit var asyncQueue: AsyncQueue | |
lateinit var fetcher: FetcherTwo | |
val client = Client() | |
beforeEachTest { | |
asyncQueue = AsyncQueue() | |
fetcher = FetcherTwo(asyncQueue, client) | |
} | |
it("perform - calls client to do other stuff") { | |
client.mockResponseStatus("successful") | |
fetcher.perform() | |
assertThat(client.actions).contains("doSomeOtherStuff") | |
} | |
it("perform - does not trigger async polling") { | |
client.mockResponseStatus("successful") | |
fetcher.perform() | |
assertThat(asyncQueue).isEmpty() | |
} | |
it("perform - triggers async polling job when accepted") { | |
client.mockResponseStatus("accepted") | |
fetcher.perform() | |
assertThat(asyncQueue).contains(fetcher::checkLastOperation) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment