.getBean(AssemblyOverdueVManager.MANAGER_NAME);
when(managerRepository.getAssemblyOverdueVManager()).thenReturn(
assemblyOverdueVmnager);
JobFunctionManager jobFunctionManager=(JobFunctionManager)ModelUtil.getBean(JobFunctionManager.MANAGER_NAME);
when(managerRepository.getJobFunctionManager()).thenReturn(jobFunctionManager);
UserType userType = new UserType();
userType.setIsAdmin(1);
when(login.getUserType()).thenReturn(userType);
ApplicationUser applicationUser = new ApplicationUser();
ProductArea productArea = productAreaManager
.findByName("Garasje villa");
applicationUser.setProductArea(productArea);
when(login.getApplicationUser()).thenReturn(applicationUser);
final Supplier supplier = new Supplier();
supplier.setSupplierId(47);
supplier.setSupplierName("S�rensen Garagebygg ANS");
final YearWeek yearWeek = new YearWeek(2009, 34);
final CraningCostManager craningCostManager = (CraningCostManager) ModelUtil
.getBean(CraningCostManager.MANAGER_NAME);
final AssemblyReportFactory assemblyReportFactory = new AssemblyReportFactory() {
public AssemblyReport create(Order order,
List<Ordln> vismaOrderLines) {
return new AssemblyReportImpl(craningCostManager, order,
vismaOrderLines);
}
};
final PreventiveActionViewHandler preventiveActionViewHandler = new PreventiveActionViewHandler(
login, managerRepository);
final DeviationViewHandlerFactory deviationViewHandlerFactory = new DeviationViewHandlerFactory() {
public DeviationViewHandler create(Order aOrder, boolean doSeAll,
boolean forOrderInfo, boolean isForRegisterNew,
Deviation notDisplayDeviation,
boolean isDeviationTableEditable) {
return new DeviationViewHandler(login, managerRepository,
preventiveActionViewHandler, aOrder, doSeAll,
forOrderInfo, isForRegisterNew, notDisplayDeviation,
isDeviationTableEditable);
}
};
final DeviationOverviewViewFactory deviationOverviewViewFactory = new DeviationOverviewViewFactory() {
public DeviationOverviewView create(
DeviationViewHandler deviationViewHandler,
boolean useSearchButton, Order aOrder, boolean doSeeAll,
boolean forOrderInfo, boolean isForRegisterNew,
Deviation notDisplayDeviation,
boolean isDeviationTableEditable) {
return new DeviationOverviewView(preventiveActionViewHandler,
deviationViewHandler, useSearchButton, aOrder,
doSeeAll, forOrderInfo, isForRegisterNew,
notDisplayDeviation, isDeviationTableEditable);
}
};
final OrderViewHandlerFactory orderViewHandlerFactory = new OrderViewHandlerFactory() {
public OrderViewHandler create(boolean notInitData) {
return new OrderViewHandler(login, managerRepository,
deviationOverviewViewFactory,
deviationViewHandlerFactory, notInitData);
}
};
final SupplierOrderViewHandler supplierOrderViewHandler = new SupplierOrderViewHandler(
login, managerRepository, assemblyReportFactory,
deviationViewHandlerFactory, orderViewHandlerFactory, supplier,
yearWeek);
Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
UserTypeAccess userTypeAccess = new UserTypeAccess();
userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
null));
userTypeAccesses.add(userTypeAccess);
userType.setUserTypeAccesses(userTypeAccesses);
final List<Supplier> supplierList = new ArrayList<Supplier>();
supplierList.add(supplier);
final OrderViewHandler orderViewHandler = new OrderViewHandler(login,