ImageFSM { @OnTransit public void onImageQueued(@Event ImageQueuedEvent event) { if (event.isSync()) { Image image = event.getImage(); LOG.info("Marking image {} ({}) as queued", image.getName(), image.getId()); image.setState(ImageState.QUEUED); imagesAware.saveImage(image); } } @Autowired  ImageFSM(OperationProcessor operationProcessor, ImagesAware imagesAware, CloudConfigurationProvider cloudConfigurationProvider, MailSender mailSender); @BeforeTransit void beforeTransit(@Event ImageEvent imageEvent); @OnTransit void onImageQueued(@Event ImageQueuedEvent event); @OnTransit void onImageSaving(@Event ImageSavingEvent event); @OnTransit void onImageSaved(@Event ImageSavedEvent event); @OnTransit void onImageDeleting(@Event ImageDeletingEvent event); @OnTransit void onImageError(@FromState ImageEvent from, @Event ImageErrorEvent event); @OnException void onUnsupportedOperationException(UnsupportedOperationException e);  }
@Test public void testOnImageQueued() { testOnImageSyncEvent(ImageQueuedEvent.class, QUEUED); }