takstolPackageVManager);
TakstolProductionVManager takstolProsuctionVManager = (TakstolProductionVManager) ModelUtil
.getBean(TakstolProductionVManager.MANAGER_NAME);
when(managerRepository.getTakstolProductionVManager()).thenReturn(
takstolProsuctionVManager);
final ApplicationUser applicationUser = new ApplicationUser();
when(login.getApplicationUser()).thenReturn(applicationUser);
final UserType userType = new UserType();
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);
userType.setIsAdmin(1);
when(login.getUserType()).thenReturn(userType);
ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
.getBean(ProductAreaManager.MANAGER_NAME);
when(managerRepository.getProductAreaManager()).thenReturn(
productAreaManager);
DeviationStatusManager deviationStatusManager = (DeviationStatusManager) ModelUtil
.getBean(DeviationStatusManager.MANAGER_NAME);
when(managerRepository.getDeviationStatusManager()).thenReturn(
deviationStatusManager);
ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
.getBean(ApplicationUserManager.MANAGER_NAME);
when(managerRepository.getApplicationUserManager()).thenReturn(
applicationUserManager);
ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
.getBean(ArticleTypeManager.MANAGER_NAME);
when(managerRepository.getArticleTypeManager()).thenReturn(
articleTypeManager);
ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
.getBean(ProductAreaGroupManager.MANAGER_NAME);
when(managerRepository.getProductAreaGroupManager()).thenReturn(
productAreaGroupManager);
OrderManager orderManager = (OrderManager) ModelUtil
.getBean(OrderManager.MANAGER_NAME);
when(managerRepository.getOrderManager()).thenReturn(orderManager);
ProductArea productArea = new ProductArea();
ProductAreaGroup productAreaGroup = productAreaGroupManager
.findByName("Garasje");
productArea.setProductAreaGroup(productAreaGroup);
applicationUser.setProductArea(productArea);
final DeviationManager deviationManager = (DeviationManager) ModelUtil
.getBean(DeviationManager.MANAGER_NAME);
final PreventiveActionManager preventiveActionManager = (PreventiveActionManager) ModelUtil
.getBean(PreventiveActionManager.MANAGER_NAME);