File tree Expand file tree Collapse file tree
xc-core/src/test/java/org/xcommand/core/multi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,15 +16,14 @@ class MultiCommandProviderTest {
1616
1717 /** Used by fromClass — must have a public no-arg constructor. */
1818 public static class SampleCommands {
19- boolean helloCalled ;
20- boolean byeCalled ;
19+ String lastCalled ;
2120
2221 public void hello (Map <String , Object > ctx ) {
23- helloCalled = true ;
22+ lastCalled = "hello" ;
2423 }
2524
2625 public void bye (Map <String , Object > ctx ) {
27- byeCalled = true ;
26+ lastCalled = "bye" ;
2827 }
2928
3029 /** No parameter — must NOT appear in commandMap. */
@@ -83,8 +82,7 @@ void executing_hello_command_invokes_hello_on_the_original_object() {
8382
8483 provider .getCommand ("hello" ).execute ();
8584
86- assertThat (target .helloCalled ).isTrue ();
87- assertThat (target .byeCalled ).isFalse ();
85+ assertThat (target .lastCalled ).isEqualTo ("hello" );
8886 }
8987
9088 @ Test
@@ -94,7 +92,6 @@ void executing_bye_command_invokes_bye_on_the_original_object() {
9492
9593 provider .getCommand ("bye" ).execute ();
9694
97- assertThat (target .helloCalled ).isFalse ();
98- assertThat (target .byeCalled ).isTrue ();
95+ assertThat (target .lastCalled ).isEqualTo ("bye" );
9996 }
10097}
You can’t perform that action at this time.
0 commit comments