@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
.getBean(ProductAreaManager.MANAGER_NAME);
AssemblyManager assemblyManager = (AssemblyManager) ModelUtil
.getBean(AssemblyManager.MANAGER_NAME);
SupplierManager supplierManager = (SupplierManager) ModelUtil
.getBean(SupplierManager.MANAGER_NAME);
OrderManager orderManager = (OrderManager) ModelUtil
.getBean(OrderManager.MANAGER_NAME);
when(managerRepository.getProductAreaManager()).thenReturn(
productAreaManager);
when(managerRepository.getAssemblyManager())
.thenReturn(assemblyManager);
when(managerRepository.getSupplierManager())
.thenReturn(supplierManager);
when(managerRepository.getOrderManager()).thenReturn(orderManager);
AssemblyOverdueVManager assemblyOverdueVmnager = (AssemblyOverdueVManager) ModelUtil
.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);