11package com .codingchili .core .context ;
22
33import com .codingchili .core .configuration .system .LauncherSettings ;
4+ import com .codingchili .core .context .exception .NoSuchCommandException ;
45import com .codingchili .core .files .Configurations ;
56import com .codingchili .core .testing .MockLogListener ;
67import io .vertx .core .Future ;
@@ -61,16 +62,25 @@ private Command getHiddenCommand() {
6162
6263 @ Test
6364 public void testGetHelpMessage (TestContext test ) {
64- try {
65- execute (MISSING_COMMAND );
66- } catch (CoreRuntimeException e ) {
65+ Async async = test .async ();
66+ Future <CommandResult > future = Future .future ();
67+
68+ future .setHandler (done -> {
69+ test .assertFalse (done .succeeded ());
70+ Throwable e = done .cause ();
6771 test .assertTrue (e .getMessage ().contains (HELP ));
6872 test .assertTrue (e .getMessage ().contains (MISSING_COMMAND ));
69- }
73+ async .complete ();
74+ });
75+
76+ new LauncherCommandExecutor (
77+ new LaunchContextMock ((line ) -> {}).logger ())
78+ .execute (future , MISSING_COMMAND );
7079 }
7180
7281 @ Test
7382 public void testConfiguredBlocksListed (TestContext test ) {
83+ System .err .println (getOutput (HELP ));
7484 test .assertTrue (getOutput (HELP ).contains (BLOCK_1 ));
7585 test .assertTrue (getOutput (HELP ).contains (BLOCK_2 ));
7686 }
@@ -97,7 +107,7 @@ private String getOutput(String arg) {
97107
98108
99109 execute (arg , logged -> {
100- message [0 ] += logged ;
110+ message [0 ] += logged + " \n " ;
101111 });
102112
103113 return message [0 ];
0 commit comments