use of org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand in project kie-wb-common by kiegroup.
the class ValidationActionTest method loadingCompletedOnSuccess.
@Test
public void loadingCompletedOnSuccess() {
final Command loadingCompleted = mock(Command.class);
new ValidationAction(editorSessionCommands, () -> {
/* */
}, loadingCompleted, s -> {
/* */
}).validate();
verify(validateSessionCommand).execute(violationsArgumentCapture.capture());
violationsArgumentCapture.getValue().onSuccess();
verify(loadingCompleted).execute();
}
use of org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand in project kie-wb-common by kiegroup.
the class ValidationActionTest method loadingCompletedOnError.
@Test
public void loadingCompletedOnError() {
final Command loadingCompleted = mock(Command.class);
final Consumer onError = mock(Consumer.class);
new ValidationAction(editorSessionCommands, () -> {
/* */
}, loadingCompleted, onError).validate();
verify(validateSessionCommand).execute(violationsArgumentCapture.capture());
violationsArgumentCapture.getValue().onError(new HashSet<>());
verify(loadingCompleted).execute();
verify(onError).accept(eq("[]"));
}
Aggregations