@Test
public void testOpenOrder() {
dialogFixture.requireVisible();
JTableFixture tableFixture = dialogFixture
.table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());
tableFixture.cell(row(0).column(2)).click();
Order selectedOrder = productionOverviewViewHandler.getSelectedObject()
.getOrder();
final PreventiveActionViewHandler preventiveActionViewHandler = new PreventiveActionViewHandler(
login, managerRepository);
DeviationViewHandler deviationViewHandler = new DeviationViewHandler(
login, managerRepository, preventiveActionViewHandler,
selectedOrder, true, false, true, null, true);
when(
deviationViewHandlerFactory.create(selectedOrder, true, true,
false, null, false)).thenReturn(deviationViewHandler);
DeviationOverviewView deviationOverviewView = new DeviationOverviewView(
preventiveActionViewHandler, deviationViewHandler, false,
selectedOrder, true, false, true, null, true);
when(
deviationOverviewViewFactory.create(deviationViewHandler,
false, selectedOrder, true, true, false, null, false))
.thenReturn(deviationOverviewView);
tableFixture.cell(row(0).column(2)).rightClick();
JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
.findByName("PopupMenuProduction"));
popupMenuFixture.menuItem("MenuItemOpenOrder").click();