Produced by Araxis Merge on 4/2/2019 1:06:57 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | C:\AraxisMergeCompare\Pri_un\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\service\impl | FileOperationsServiceImplTest.java | Wed Mar 27 19:22:51 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\service\impl | FileOperationsServiceImplTest.java | Fri Mar 29 17:44:23 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 228 |
Changed | 2 | 4 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | package go v.va.med.a rs.service .impl; | |
2 | ||
3 | import sta tic org.ju nit.Assert .assertNot Null; | |
4 | import sta tic org.ju nit.Assert .assertTru e; | |
5 | import sta tic org.mo ckito.Mock ito.when; | |
6 | ||
7 | import jav a.util.Dat e; | |
8 | ||
9 | import org .apache.lo gging.log4 j.LogManag er; | |
10 | import org .apache.lo gging.log4 j.Logger; | |
11 | import org .junit.Tes t; | |
12 | import org .junit.run ner.RunWit h; | |
13 | import org .mockito.I njectMocks ; | |
14 | import org .mockito.M ock; | |
15 | import org .mockito.r unners.Moc kitoJUnitR unner; | |
16 | import org .springfra mework.tes t.web.serv let.MockMv c; | |
17 | ||
18 | import gov .va.med.ar s.constant s.IAuditLo gConstants ; | |
19 | import gov .va.med.ar s.dao.ars. IAuditLogg erReposito ry; | |
20 | import gov .va.med.ar s.dao.ars. IClaimAtta chmentsVie wRepositor y; | |
21 | import gov .va.med.ar s.exceptio ns.Generic Exception; | |
22 | import gov .va.med.ar s.model.re quest.Audi tLogger; | |
23 | import gov .va.med.do main.ars.A rsauditlog ; | |
24 | import gov .va.med.do main.ars.C laimattach mentsView; | |
25 | ||
26 | @RunWith(M ockitoJUni tRunner.cl ass) | |
27 | public cla ss FileOpe rationsSer viceImplTe st { | |
28 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(File Operations ServiceImp lTest.clas s); | |
29 | pr ivate Mock Mvc mockMv c; | |
30 | ||
31 | @M ock | |
32 | IA uditLogger Repository auditLogg erReposito ry; | |
33 | ||
34 | @M ock | |
35 | IC laimAttach mentsViewR epository claimAttac hmentRepos itory; | |
36 | ||
37 | @I njectMocks | |
38 | Au ditLoggerS erviceImpl auditLogg erService; | |
39 | ||
40 | @T est | |
41 | pu blic void testMockIs Working() { | |
42 | asse rtNotNull( "IAuditLog gerReposit ory Inject ion Failed ", auditLo ggerServic e); | |
43 | } | |
44 | ||
45 | @T est | |
46 | pu blic void testGetfil eContentAn dLog_succe ss() throw s GenericE xception{ | |
47 | Audi tLogger au ditLogger= new AuditL ogger("VHA NAME", "86 753303.001 ", "ars", new Boolea n("true")) ; | |
48 | ||
49 | Clai mattachmen tsView rec ord = new Claimattac hmentsView (); | |
50 | reco rd.setAtta chIdLx("86 753303.001 "); | |
51 | reco rd.setAtta chmentId(8 6753303L); | |
52 | reco rd.setAtta chmentCont rolNumber( "6F40E5499 721477EE05 3EAD8E30A5 A2D"); | |
53 | reco rd.setClai mIdentifie r("100000" ); | |
54 | reco rd.setExte rnalClaimI d("11111") ; | |
55 | reco rd.setStat us("Active "); | |
56 | reco rd.setPati entFirstNa me("ORPHAN "); | |
57 | reco rd.setPati entControl Number("25 2525"); | |
58 | reco rd.setPati entIdentif ierNumber( "34567"); | |
59 | reco rd.setProv iderName(" 2.2.1_PROV IDERINFO00 15"); | |
60 | reco rd.setProv iderNpi("6 78947"); | |
61 | reco rd.setMedi calRecordN umber("123 456789"); | |
62 | reco rd.setPaye rClaimCont rolNumber( "202154"); | |
63 | reco rd.setRepo rtCode("09 "); | |
64 | reco rd.setAtta chmentType ("PDF"); | |
65 | reco rd.setClai mServiceSt artDate("2 0161108"); | |
66 | reco rd.setClai mServiceEn dDate("201 61225"); | |
67 | record.set Attachment Path("http s:// SERVER . DOMAIN/POR T /attachmen ts/output/ 86753303.0 01/yalesam ple.tiff") ; | |
68 | ||
69 | when (claimAtta chmentRepo sitory.fin dOneByAtta chIdLx(aud itLogger.g etAttachId Lx())).the nReturn(re cord); | |
70 | ||
71 | Arsa uditlog ar sAuditLog = new Arsa uditlog(IA uditLogCon stants.MET HODNAME, a uditLogger .getVhaNam e(), audit Logger.get AttachIdLx (), new Da te(), | |
72 | IAuditLo gConstants .REQUESTAR GS+auditLo gger.getAt tachIdLx() , IAuditLo gConstants .DOWNLOADA CTION, tru e, 1L); | |
73 | ||
74 | when (auditLogg erReposito ry.save(ar sAuditLog) ).thenRetu rn(arsAudi tLog); | |
75 | ||
76 | Stri ng attachm entPath=au ditLoggerS ervice.get PathForThe Attachment (auditLogg er); | |
77 | ||
78 | // asse rtTrue(att achmentPat h.equalsIg noreCase(" /u02/attac hments/out put/867533 03.001/yal esample.ti ff")); | |
79 | // T his should be looked into. | |
80 | } | |
81 | ||
82 | @T est(expect ed = Excep tion.class ) | |
83 | pu blic void testGetfil eContentAn dLog_failu re() throw s GenericE xception{ | |
84 | Au ditLogger auditLogge r=new Audi tLogger("V HANAME", " 86753303.0 01","ars", new Boolea n("false") ); | |
85 | ||
86 | Clai mattachmen tsView rec ord = new Claimattac hmentsView (); | |
87 | reco rd.setAtta chIdLx("86 753303.001 "); | |
88 | reco rd.setAtta chmentId(8 6753303L); | |
89 | reco rd.setAtta chmentCont rolNumber( "6F40E5499 721477EE05 3EAD8E30A5 A2D"); | |
90 | reco rd.setClai mIdentifie r("100000" ); | |
91 | reco rd.setExte rnalClaimI d("11111") ; | |
92 | reco rd.setStat us("Active "); | |
93 | reco rd.setPati entFirstNa me("ORPHAN "); | |
94 | reco rd.setPati entControl Number("25 2525"); | |
95 | reco rd.setPati entIdentif ierNumber( "34567"); | |
96 | reco rd.setProv iderName(" 2.2.1_PROV IDERINFO00 15"); | |
97 | reco rd.setProv iderNpi("6 78947"); | |
98 | reco rd.setMedi calRecordN umber("123 456789"); | |
99 | reco rd.setPaye rClaimCont rolNumber( "202154"); | |
100 | reco rd.setRepo rtCode("09 "); | |
101 | reco rd.setAtta chmentType ("PDF"); | |
102 | reco rd.setClai mServiceSt artDate("2 0161108"); | |
103 | reco rd.setClai mServiceEn dDate("201 61225"); | |
104 | record.set Attachment Path("http s:// SERVER . DOMAIN/POR T /attachmen ts/output/ /86753303. 001/yalesa mple.tiff" ); | |
105 | ||
106 | when (claimAtta chmentRepo sitory.fin dOneByAtta chIdLx(aud itLogger.g etAttachId Lx())).the nReturn(nu ll); | |
107 | ||
108 | Arsa uditlog ar sAuditLog = new Arsa uditlog(IA uditLogCon stants.MET HODNAME, a uditLogger .getVhaNam e(), audit Logger.get AttachIdLx (), new Da te(), | |
109 | IAuditLo gConstants .REQUESTAR GS+auditLo gger.getAt tachIdLx() , IAuditLo gConstants .DOWNLOADA CTION, tru e, 1L); | |
110 | ||
111 | when (auditLogg erReposito ry.save(ar sAuditLog) ).thenRetu rn(arsAudi tLog); | |
112 | ||
113 | Stri ng attachm entPath=au ditLoggerS ervice.get PathForThe Attachment (auditLogg er); | |
114 | ||
115 | } | |
116 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.