when(managerRepository.getProductAreaGroupManager()).thenReturn(
productAreaGroupManager);
OrderManager orderManager = (OrderManager) ModelUtil
.getBean(OrderManager.MANAGER_NAME);
when(managerRepository.getOrderManager()).thenReturn(orderManager);
UserType userType = new UserType();
userType.setIsAdmin(1);
when(login.getUserType()).thenReturn(userType);
OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
.getBean(OrderLineManager.MANAGER_NAME);
when(managerRepository.getOrderLineManager()).thenReturn(
orderLineManager);
ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
.getBean(ArticleTypeManager.MANAGER_NAME);
when(managerRepository.getArticleTypeManager()).thenReturn(
articleTypeManager);
FrontProductionVManager frontProductionVManager = (FrontProductionVManager) ModelUtil
.getBean(FrontProductionVManager.MANAGER_NAME);
when(managerRepository.getFrontProductionVManager()).thenReturn(
frontProductionVManager);
ProductionUnitManager productionUnitManager = (ProductionUnitManager) ModelUtil
.getBean(ProductionUnitManager.MANAGER_NAME);
when(managerRepository.getProductionUnitManager()).thenReturn(
productionUnitManager);
ColliManager colliManager = (ColliManager) ModelUtil
.getBean(ColliManager.MANAGER_NAME);
when(managerRepository.getColliManager()).thenReturn(colliManager);
TakstolProductionVManager takstolProductionVManager = (TakstolProductionVManager) ModelUtil
.getBean(TakstolProductionVManager.MANAGER_NAME);
when(managerRepository.getTakstolProductionVManager()).thenReturn(
takstolProductionVManager);
TakstolPackageVManager takstolPackageVManager=(TakstolPackageVManager)ModelUtil.getBean(TakstolPackageVManager.MANAGER_NAME);
when(managerRepository.getTakstolPackageVManager()).thenReturn(
takstolPackageVManager);
// vismaFileCreator =context.mock(VismaFileCreator.class);
// managerRepository = context.mock(ManagerRepository.class);
// deviationViewHandlerFactory = context
// .mock(DeviationViewHandlerFactory.class);
// login = context.mock(Login.class);
// final PreventiveActionManager preventiveActionManager =
// (PreventiveActionManager) ModelUtil
// .getBean(PreventiveActionManager.MANAGER_NAME);
Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
UserTypeAccess userTypeAccess = new UserTypeAccess();
userTypeAccess.setWriteAccess(1);
WindowAccess windowAccess = new WindowAccess();
windowAccess.setWindowName("Produksjonsenhet");
userTypeAccess.setWindowAccess(windowAccess);
userTypeAccesses.add(userTypeAccess);
userType.setUserTypeAccesses(userTypeAccesses);
// final JobFunctionManager jobFunctionManager = (JobFunctionManager)
// ModelUtil
// .getBean(JobFunctionManager.MANAGER_NAME);