Skip to content

Commit 2d72fe5

Browse files
committed
improvements
1 parent 17279a5 commit 2d72fe5

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

xc-core/src/test/java/org/xcommand/core/multi/MultiCommandProviderTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)