Because this is static it will be set to true for all attempts to print an invoice. I assume this was done to make the tests work, which would be fine, apart from we need to show the user how to use the API, so can't really do things like this.

You could have a static map of invoiceID to status. Then you could query it in wasInvoicePrinted(Integer invoiceID). You would need to use a CompensationScoped bean to 'remember' the invoiceID in the confirm method.