Package no.ugland.utransprod.service.impl

Examples of no.ugland.utransprod.service.impl.IncomingOrderManagerImpl


  }
 
  @Test
  public void importTakstein(){
//    Mockery mockery= new JUnit3Mockery();
    IncomingOrderManager incomingOrderManager = new IncomingOrderManagerImpl();
    final OrdlnManager ordlnManager=mock(OrdlnManager.class);
    final OrdlnDAO ordlnDAO=mock(OrdlnDAO.class);
    ConstructionTypeManager constructionTypeManager=new ConstructionTypeManagerImpl();
    final ArticleTypeDAO articleTypeDAO=mock(ArticleTypeDAO.class);
    ((IncomingOrderManagerImpl)incomingOrderManager).setOrdlnManager(ordlnManager);
    ((IncomingOrderManagerImpl)incomingOrderManager).setOrdlnDAO(ordlnDAO);
    ((IncomingOrderManagerImpl)incomingOrderManager).setConstructionTypeManager(constructionTypeManager);
    ((IncomingOrderManagerImpl)incomingOrderManager).setArticleTypeDAO(articleTypeDAO);
   
    final Order incomingOrder=new Order();
    incomingOrder.setOrderNr("1");
    ProductArea productArea=new ProductArea();
    ProductAreaGroup productAreaGroup=new ProductAreaGroup();
    productAreaGroup.setProductAreaGroupName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    incomingOrder.setProductArea(productArea);
   
    final List<Ordln> ordlnList=new ArrayList<Ordln>();
    Ordln ordln = new Ordln();
    ordln.setOrdlnPK(new OrdlnPK(1,1));
    Prod prod = new Prod();
    prod.setProdNo("TAKSTEIN");
    prod.setPrCatNo(1020410);
    prod.setPrCatNo2(9);
    ordln.setProd(prod);
    ordlnList.add(ordln);
   
    final Ord ord = new Ord();
    final ArticleType articleTypeTakstein=new ArticleType();
    articleTypeTakstein.setArticleTypeName("Takstein");
   
    final Collection<OrderLine> originalOrderLines =new HashSet<OrderLine>();
    OrderLine orderLineTakstol=new OrderLine();
    orderLineTakstol.setArticleName("Takstein");
    orderLineTakstol.setArticleType(articleTypeTakstein);
    originalOrderLines.add(orderLineTakstol);
   
   
    final  ManagerRepository managerRepository=mock(ManagerRepository.class);
   
    when(ordlnManager.findOrdByOrderNr("1")).thenReturn(ord);
    when(ordlnDAO.findByOrderNr("1")).thenReturn(ordlnList);
    when(articleTypeDAO.findByProdCatNoAndProdCatNo2(1020410, 9)).thenReturn(articleTypeTakstein);
   
   
    incomingOrderManager.setOrderLines(incomingOrder,managerRepository);
   
    OrderLine orderLine = incomingOrder.getOrderLine(ARTICLE_PATH_TAKSTEIN);
    assertNotNull(orderLine);
    assertFalse(orderLine==OrderLine.UNKNOWN);
  }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.service.impl.IncomingOrderManagerImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.