I'm writing some functional tests for a Swing app with UISpec4j.
There are some fields to fill in, and a button for saving. Depending on the combination of fields filled in, there might be a modal error dialog displayed when the save button is clicked.
I don't want to duplicate the logic for showing the error dialog in my test cases, just assert that the error dialog did not show when clicking the save button.
Can this be done in a less convoluted way than calling WindowInterceptor.getModalDialog() and catching AssertionError?