Trigger MenuBar.MenuItem's command for unit testing.

Hi All,

I have a builder that creates a MenuBar Component. I am now trying to create the unit tests for that Builder class. I would like to be able to simulate a user clicking on one of the Menu Items, like i can for a button with Button.click(), but there doesnt seem to be a click or comparable method on the MenuItem class.

Is there some other way of triggering the command associated with the MenuItem, so that i can test that my Builder class has actually constructed the Menu Correctly?

Note: I do not wish to test the actual command here, just that the correct command is triggered when the appropriate MenuItem is selected.

(I have found teh following https://vaadin.com/forum/#!/thread/289580/289579 which indicates that 5 years ago this functionality wasnt available… im hopeing things have moved on since then)