You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the application, I wish to trigger my command "test-command". This command then shows a selector using the SingleItemSelector and asks the user to select from 3 options.
However, in the above setup, "test-command" is correctly triggered, but I cannot find a way to give input for the selector and I am always given a NoSuchElementException (I.E. no user input was received and it did not way for user input).
I've tried many ways:
Setting spring.shell.interactive.enabled=true - but then I have no way of interacting at all as other have observed.
Using shell.run(....) but this appears to lead to the same problem
Attempting to mock the entire JLine framework, but this just led to frustration.
Versions:
Java: openjdk 11.0.16.1
Spring Shell: 2.1.1
The text was updated successfully, but these errors were encountered:
I'm going to close this in favour of #489, please follow it.
Short story is that trying to hack into spring-shell internals to do testing like this is way too difficult. We've done some integration tests which are always opinionated for current use case. Also what comes out from a JLine is just meant for a terminal emulation so you need to interpret that as well.
Yea, that's essentially what we ended up doing and it worked quite well in the end. Thanks for the fast response, and I'll keep and eye on that issue going forward!
I have followed the guide for setting up testing infrastructure as written in the GitHub issues:
My testing class looks like the following:
In the application, I wish to trigger my command "test-command". This command then shows a selector using the
SingleItemSelector
and asks the user to select from 3 options.However, in the above setup, "test-command" is correctly triggered, but I cannot find a way to give input for the selector and I am always given a NoSuchElementException (I.E. no user input was received and it did not way for user input).
I've tried many ways:
shell.run(....)
but this appears to lead to the same problemVersions:
Java: openjdk 11.0.16.1
Spring Shell: 2.1.1
The text was updated successfully, but these errors were encountered: