Index: WSimpl/Halux/AAP/DnaCodeService.cls.xml =================================================================== diff -u -r61053 -r61057 --- WSimpl/Halux/AAP/DnaCodeService.cls.xml (.../DnaCodeService.cls.xml) (revision 61053) +++ WSimpl/Halux/AAP/DnaCodeService.cls.xml (.../DnaCodeService.cls.xml) (revision 61057) @@ -151,7 +151,7 @@ If DnaCodeIterator.HasNext() { Set Response.Header.Status = "200" While DnaCodeIterator.HasNext() { - Do Response.DnaCodes.Insert(..DnaCodeNaarDto(DnaCodeIterator.Next())) + Do Response.DnaCodes.Insert(DnaCodeIterator.Next()) } } Else { Set Response.Header.Status = ##class(TECH.enu.ExceptionCode).DataNotFound() @@ -279,6 +279,8 @@ If ..IsGeldigeVhossCode(DnaCodeAfmeldenRequest.PalletCode) { Set Response = ..AantalGescandeVhossSequentieItemsBepaler.BepaalAantalGescandeVhossSequentieItems(DnaCode) + + Do ##class(Tools.Wlip).%New(127).ObjToXML(Response) Set Response.Header.Status = "200" } Else { Set ToeleveringId = DnaCode.Toelevering Index: vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/ZoekAlleVhossLadesBijDnaCode/Test.cls.xml =================================================================== diff -u -r61053 -r61057 --- vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/ZoekAlleVhossLadesBijDnaCode/Test.cls.xml (.../Test.cls.xml) (revision 61053) +++ vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/ZoekAlleVhossLadesBijDnaCode/Test.cls.xml (.../Test.cls.xml) (revision 61057) @@ -10,7 +10,9 @@ Set Request.GuiVhossVolgnummer = "1" Set DnaCode1 = ##class(DOM.Halux.AAP.DnaCode).%New() + Set DnaCode1.DnaCode = "TAD16A1" Set DnaCode2 = ##class(DOM.Halux.AAP.DnaCode).%New() + Set DnaCode2.DnaCode = "TAD16A2" #dim DnaCodeIterator As TECH.Iterator = ##class(TECH.ListUtils).CreateIteratorOfObjects(DnaCode1, DnaCode2) Set DnaCodeRepositoryMock = ##class(vhTest.Mock.DOM.Halux.AAP.DnaCodeRepository).%New() Do DnaCodeRepositoryMock.VerwachtMethodCall("ZoekViaDnaCode",Request.DnaCode).DanReturn(DnaCodeIterator) @@ -27,6 +29,8 @@ Do $$$AssertEquals(Antwoord.Header.Status,"200") Do $$$AssertEquals(Antwoord.DnaCodes.Count(),2) + Do $$$AssertEquals(Antwoord.DnaCodes.GetAt(1).DnaCode,"TAD16A1") + Do $$$AssertEquals(Antwoord.DnaCodes.GetAt(2).DnaCode,"TAD16A2") Do DnaCodeRepositoryMock.Verifieer() ]]> Index: vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler/BepaalAantalGescandeVhossSequentieItems.cls.xml =================================================================== diff -u -r61030 -r61057 --- vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler/BepaalAantalGescandeVhossSequentieItems.cls.xml (.../BepaalAantalGescandeVhossSequentieItems.cls.xml) (revision 61030) +++ vhUnitTest/WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler/BepaalAantalGescandeVhossSequentieItems.cls.xml (.../BepaalAantalGescandeVhossSequentieItems.cls.xml) (revision 61057) @@ -30,6 +30,7 @@ Set ProductieSequentieItem1 = ##class(APPS.Halux.common.VHOSSProductieSequentieItem).%New() Set ProductieSequentieItem1.VHOSSID = 1 Set ProductieSequentieItem1.SequentieNummer = 42 + Set ProductieSequentieItem1.BatchID = BatchId Set BatchStub = ##class(vhTest.Mock.APPS.Halux.common.TaorboxBatch).%New() Do BatchStub.IndienMethodCall("GeefID").DanReturn(BatchId) @@ -42,7 +43,10 @@ Do SequentieService.IndienMethodCall("HeeftProductieSequentie",DnaCode.BatchId).DanReturn($$$True) Do SequentieService.IndienMethodCall("GeefProductieSequentie",DnaCode.BatchId).DanReturn(ProductieSequentie) - Set Bepaler = ##class(WSimpl.Halux.AAP.DnaCodeService.AantalGescandeVhossSequentieItemsBepaler).%New(SequentieService) + Set DnaCodeRepository = ##class(vhTest.Mock.DOM.Halux.AAP.DnaCodeRepository).%New() + Do DnaCodeRepository.IndienMethodCall("ZoekViaBatchIdEnSequentienummer",DnaCode.BatchId,DnaCode.SequentieNummer).DanReturn(##class(TECH.ListUtils).CreateIteratorOfObjects(DnaCode)) + + Set Bepaler = ##class(WSimpl.Halux.AAP.DnaCodeService.AantalGescandeVhossSequentieItemsBepaler).%New(SequentieService, DnaCodeRepository) #dim Antwoord As WS.Halux.AAP.DnaCodeAfmeldenResponse = Bepaler.BepaalAantalGescandeVhossSequentieItems(DnaCode,1) Do $$$AssertEquals(Antwoord.AantalInToelevering,1) Do $$$AssertEquals(Antwoord.DnaCodes.Count(),1) @@ -93,6 +97,7 @@ Set ProductieSequentieItem1 = ##class(APPS.Halux.common.VHOSSProductieSequentieItem).%New() Set ProductieSequentieItem1.VHOSSID = 1 Set ProductieSequentieItem1.SequentieNummer = 42 + Set ProductieSequentieItem1.BatchID = BatchId Set BatchStub = ##class(vhTest.Mock.APPS.Halux.common.TaorboxBatch).%New() Do BatchStub.IndienMethodCall("GeefID").DanReturn(BatchId) @@ -118,18 +123,24 @@ @@ -157,18 +172,29 @@ Set DnaCode.DnaCode = "HABCDE0" Set DnaCode.BatchId = BatchId Set DnaCode.SequentieNummer = 42 + Set DnaCode2 = ##class(DOM.Halux.AAP.DnaCode).%New() + Set DnaCode2.DnaCode = "HABCDE1" + Set DnaCode2.BatchId = BatchId + Set DnaCode2.SequentieNummer = 43 + Set DnaCode3 = ##class(DOM.Halux.AAP.DnaCode).%New() + Set DnaCode3.DnaCode = "HABCDE2" + Set DnaCode3.BatchId = BatchId + Set DnaCode3.SequentieNummer = 44 Set ProductieSequentieItem1 = ##class(APPS.Halux.common.VHOSSProductieSequentieItem).%New() Set ProductieSequentieItem1.VHOSSID = 1 Set ProductieSequentieItem1.SequentieNummer = 42 + Set ProductieSequentieItem1.BatchID = BatchId Set ProductieSequentieItem2 = ##class(APPS.Halux.common.VHOSSProductieSequentieItem).%New() Set ProductieSequentieItem2.VHOSSID = 2 Set ProductieSequentieItem2.SequentieNummer = 43 + Set ProductieSequentieItem2.BatchID = BatchId Set ProductieSequentieItem3 = ##class(APPS.Halux.common.VHOSSProductieSequentieItem).%New() Set ProductieSequentieItem3.VHOSSID = 2 Set ProductieSequentieItem3.SequentieNummer = 44 + Set ProductieSequentieItem3.BatchID = BatchId Set BatchStub = ##class(vhTest.Mock.APPS.Halux.common.TaorboxBatch).%New() Do BatchStub.IndienMethodCall("GeefID").DanReturn(BatchId) @@ -183,7 +209,12 @@ Do SequentieService.IndienMethodCall("HeeftProductieSequentie",DnaCode.BatchId).DanReturn($$$True) Do SequentieService.IndienMethodCall("GeefProductieSequentie",DnaCode.BatchId).DanReturn(ProductieSequentie) - Set Bepaler = ##class(WSimpl.Halux.AAP.DnaCodeService.AantalGescandeVhossSequentieItemsBepaler).%New(SequentieService) + Set DnaCodeRepository = ##class(vhTest.Mock.DOM.Halux.AAP.DnaCodeRepository).%New() + Do DnaCodeRepository.IndienMethodCall("ZoekViaBatchIdEnSequentienummer",DnaCode.BatchId,DnaCode.SequentieNummer).DanReturn(##class(TECH.ListUtils).CreateIteratorOfObjects(DnaCode)) + Do DnaCodeRepository.IndienMethodCall("ZoekViaBatchIdEnSequentienummer",DnaCode2.BatchId,DnaCode2.SequentieNummer).DanReturn(##class(TECH.ListUtils).CreateIteratorOfObjects(DnaCode2)) + Do DnaCodeRepository.IndienMethodCall("ZoekViaBatchIdEnSequentienummer",DnaCode3.BatchId,DnaCode3.SequentieNummer).DanReturn(##class(TECH.ListUtils).CreateIteratorOfObjects(DnaCode3)) + + Set Bepaler = ##class(WSimpl.Halux.AAP.DnaCodeService.AantalGescandeVhossSequentieItemsBepaler).%New(SequentieService, DnaCodeRepository) #dim Antwoord As WS.Halux.AAP.DnaCodeAfmeldenResponse = Bepaler.BepaalAantalGescandeVhossSequentieItems(DnaCode,1) Do $$$AssertEquals(Antwoord.AantalInToelevering,1) Do $$$AssertEquals(Antwoord.DnaCodes.Count(),1) Index: WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler.cls.xml =================================================================== diff -u -r61051 -r61057 --- WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler.cls.xml (.../AantalGescandeVhossSequentieItemsBepaler.cls.xml) (revision 61051) +++ WSimpl/Halux/AAP/DnaCodeService/AantalGescandeVhossSequentieItemsBepaler.cls.xml (.../AantalGescandeVhossSequentieItemsBepaler.cls.xml) (revision 61057) @@ -72,7 +72,7 @@ While ItemIterator.HasNext() { Set TbxSequentie = ItemIterator.Next() If TbxSequentie.GetData(2) = VhossidVanDnaCode { - Do Resultaat.DnaCodes.Insert(..DnaCodeNaarDto(DnaCode)) + Do Resultaat.DnaCodes.Insert(..DnaCodeNaarDto(..DnaCodeRepository.ZoekViaBatchIdEnSequentienummer(DnaCode.BatchId,TbxSequentie.GetData(1)).Next())) } } @@ -132,7 +132,7 @@ While ItemIterator.HasNext() { Set ProductieSequentieItem = ItemIterator.Next() If ProductieSequentieItem.VHOSSID = VhossidVanDnaCode { - Do Resultaat.DnaCodes.Insert(..DnaCodeNaarDto(DnaCode)) + Do Resultaat.DnaCodes.Insert(..DnaCodeNaarDto(..DnaCodeRepository.ZoekViaBatchIdEnSequentienummer(ProductieSequentieItem.BatchID,ProductieSequentieItem.SequentieNummer).Next())) } }