Last active
February 27, 2019 11:09
-
-
Save lordofthejars/cc9e0e0da24a30df2e24a192f80e100b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@ExtendWith(OdoExecutorStubInjector.class) | |
public class OdoExecutorStubTest { | |
@Test | |
public void should_run_commands(OdoExecutorStub odoExecutorStub) { | |
// Given | |
final Odo odo = new Odo(odoExecutorStub); | |
// When | |
odo.createUrl().build().execute(); | |
// Then | |
assertThat(odoExecutorStub).hasExecuted("odo url create"); | |
} | |
@Test | |
public void should_run_commands_with_output(OdoExecutorStub odoExecutorStub) throws IOException { | |
// Given | |
final List<String> urlList = Files.readAllLines(Paths.get("src/test/resources", "url_list.json")); | |
final Odo odo = new Odo(odoExecutorStub); | |
// When | |
odoExecutorStub.recordOutput(urlList); | |
final UrlList list = odo.listUrls().build().execute(); | |
// Then | |
assertThat(odoExecutorStub).hasExecuted("odo url list --output json"); | |
Assertions.assertThat(list.getItems()).hasSize(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment