### Question:
IntegrationHandlerImpl implements IntegrationHandler { @Override public void migrateFromJBPMDesignerToStunner(Path path, PlaceRequest place, boolean isDirty, ParameterizedCommand<Consumer<Boolean>> saveCommand) { checkIfDirtyAndMigrate(isDirty, saveCommand, () -> fromJBPMDesignerToStunner(path, place)); } IntegrationHandlerImpl(); @Inject  IntegrationHandlerImpl(final Caller<IntegrationService> integrationService,
                                  final PlaceManager placeManger,
                                  final PopupUtil popupUtil,
                                  final ErrorPopupPresenter errorPopup,
                                  final MarshallingResponsePopup responsePopup,
                                  final ClientTranslationService translationService,
                                  final Event<NotificationEvent> notification); @Override void migrateFromJBPMDesignerToStunner(Path path, PlaceRequest place, boolean isDirty, ParameterizedCommand<Consumer<Boolean>> saveCommand); @Override void migrateFromStunnerToJBPMDesigner(Path path, PlaceRequest place, boolean isDirty, ParameterizedCommand<Consumer<Boolean>> saveCommand);  }### Answer:
@Test public void testMigrateFromJBPMDesignerToStunnerWithUnexpectedError() { prepareServiceCallerError(integrationService, integrationServiceCaller, new Throwable(ERROR)); handler.migrateFromJBPMDesignerToStunner(jbpmPath, place, false, saveSuccessfulCommand); verifyUserWasAskedForStartingToStunnerMigrationAndRespond(true); String expectedMessage = MigrateActionUnexpectedErrorMessage + "\n" + ERROR; verify(errorPopup).showMessage(expectedMessage); }
@Test @SuppressWarnings("unchecked") public void testMigrateFromJBPMDesignerToStunnerWithUnexpectedErrorNoDiagramWasReturned() { MarshallingResponse<ProjectDiagram> marshallingResponse = new MarshallingResponse.MarshallingResponseBuilder<ProjectDiagram>() .state(MarshallingResponse.State.SUCCESS) .messages(Collections.EMPTY_LIST) .result(null) .build(); when(integrationService.getDiagramByPath(jbpmPath, MarshallingRequest.Mode.AUTO)).thenReturn(marshallingResponse); handler.migrateFromJBPMDesignerToStunner(jbpmPath, place, false, saveSuccessfulCommand); verifyUserWasAskedForStartingToStunnerMigrationAndRespond(true); verify(errorPopup).showMessage(MigrateToStunnerNoDiagramHasBeenReturned); }