Produced by Araxis Merge on 2/4/2019 11:34:05 AM Eastern Standard 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 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\test\java\gov\va\mobile\vamf\mhpro\rpc\dao\impl | RpcReportTemplateDAOTest.java | Tue Nov 14 19:31:17 2017 UTC |
| 2 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\test\java\gov\va\mobile\vamf\mhpro\rpc\dao\impl | RpcReportTemplateDAOTest.java | Fri Feb 1 19:27:43 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 374 |
| Changed | 1 | 2 |
| 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.mobil e.vamf.mhp ro.rpc.dao .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.Matc hers.any; | |
| 6 | import sta tic org.mo ckito.Mock ito.when; | |
| 7 | ||
| 8 | import jav a.util.Arr ayList; | |
| 9 | import jav a.util.Has hMap; | |
| 10 | import jav a.util.Lis t; | |
| 11 | import jav a.util.Map ; | |
| 12 | ||
| 13 | import jav ax.resourc e.cci.Conn ectionSpec ; | |
| 14 | ||
| 15 | import org .junit.Aft er; | |
| 16 | import org .junit.Bef ore; | |
| 17 | import org .junit.Tes t; | |
| 18 | import org .junit.run ner.RunWit h; | |
| 19 | import org .mockito.M ock; | |
| 20 | import org .mockito.r unners.Moc kitoJUnitR unner; | |
| 21 | import org .springfra mework.tes t.util.Ref lectionTes tUtils; | |
| 22 | ||
| 23 | import gov .va.med.ci ss.service .VistaCust omization; | |
| 24 | import gov .va.med.ci ss.service .log.Logge rListener; | |
| 25 | import gov .va.med.ci ss.service .vista.RPC Exception; | |
| 26 | import gov .va.med.ci ss.service .vista.Rpc ServiceUti l; | |
| 27 | import gov .va.med.ci ss.service .vista.Rpc ServiceUti lFactory; | |
| 28 | import gov .va.med.ci ss.service .vista.Rpc Uitl; | |
| 29 | import gov .va.med.ci ss.service .vistalink .KaajeeSer vice; | |
| 30 | import gov .va.med.ci ss.service .vistalink .VistaLink Service; | |
| 31 | import gov .va.mobile .vamf.mhpr o.rpc.Answ er; | |
| 32 | import gov .va.mobile .vamf.mhpr o.rpc.Choi ce; | |
| 33 | import gov .va.mobile .vamf.mhpr o.service. IVistaLink AuditServi ce; | |
| 34 | ||
| 35 | /** | |
| 36 | * @author PII | |
| 37 | * | |
| 38 | * The Cla ss RpcRepo rtTemplate DAOTest. | |
| 39 | */ | |
| 40 | @RunWith(M ockitoJUni tRunner.cl ass) | |
| 41 | public cla ss RpcRepo rtTemplate DAOTest { | |
| 42 | ||
| 43 | /* * The rpc ReportTemp late dao. */ | |
| 44 | pr ivate RpcR eportTempl ateDAO rpc ReportTemp lateDAO; | |
| 45 | ||
| 46 | /* * The rpc service ut il factory . */ | |
| 47 | @M ock | |
| 48 | pr ivate RpcS erviceUtil Factory rp cServiceUt ilFactory; | |
| 49 | @M ock | |
| 50 | privat e IVistaLi nkAuditSer vice vista LinkAuditS ervice; | |
| 51 | ||
| 52 | protec ted static final Str ing RPC_NA ME = "YTQ ALL ANSWER S"; | |
| 53 | pr ivate stat ic final S tring MCHO ICE = "MCH OICE"; | |
| 54 | pr ivate stat ic final S tring STRI NG = "STRI NG"; | |
| 55 | ||
| 56 | /* * | |
| 57 | * Sets the up. | |
| 58 | * | |
| 59 | * @throws E xception t he excepti on | |
| 60 | * / | |
| 61 | @B efore | |
| 62 | pu blic void setUp() th rows Excep tion { | |
| 63 | rpcR eportTempl ateDAO = n ew RpcRepo rtTemplate DAO(); | |
| 64 | Refl ectionTest Utils.setF ield(rpcRe portTempla teDAO, "rp cServiceUt ilFactory" , rpcServi ceUtilFact ory); | |
| 65 | ||
| 66 | Refl ectionTest Utils.setF ield(rpcRe portTempla teDAO, "vi staLinkAud itService" , vistaLin kAuditServ ice); | |
| 67 | } | |
| 68 | ||
| 69 | /* * | |
| 70 | * Tear down . | |
| 71 | * | |
| 72 | * @throws E xception t he excepti on | |
| 73 | * / | |
| 74 | @A fter | |
| 75 | pu blic void tearDown() throws Ex ception { | |
| 76 | } | |
| 77 | ||
| 78 | /* * | |
| 79 | * Test rpc ChoiceType Describe d ao. | |
| 80 | * | |
| 81 | * @throws E xception t he excepti on | |
| 82 | * / | |
| 83 | @T est | |
| 84 | pu blic void testRpcCho icesDAO() throws Exc eption { | |
| 85 | Mock RpcService Util mockU til = new MockRpcSer viceUtil(n ull,null, null); | |
| 86 | when (rpcServic eUtilFacto ry.getInst ance(any(O bject.clas s))).thenR eturn(mock Util); | |
| 87 | ||
| 88 | //pu blic Strin g retrieve ChoiceType Describe(S tring divi sion, Stri ng instrum ent, Vista AccessLogE ntry entry ){ | |
| 89 | //Li st<Choice> choices = rpcChoice TypeDescri beDAO.retr ieveChoice TypeDescri be(divisio n, instrum ent, entry ); | |
| 90 | //Li st<Choice> choices = rpcChoice TypeDescri beDAO.retr ieveChoice s("442", " GAD-7", "7 4"); | |
| 91 | ||
| 92 | Stri ng divisio n = "442"; | |
| 93 | Stri ng adminis trationId = "1"; | |
| 94 | St ring duz = "74"; | |
| 95 | Object a uthToken = RpcUitl.g etOrResetA uthToken(d ivision , null); | |
| 96 | List <Object> a rguments = new Array List<>(); | |
| 97 | Map< String, St ring> map = new Hash Map<>(); | |
| 98 | ||
| 99 | map. put("AD", administra tionId); | |
| 100 | argu ments.add( map); | |
| 101 | ||
| 102 | Vist aAccessLog Entry entr y = new Vi staAccessL ogEntry(di vision, du z, RPC_NAM E, map); | |
| 103 | ||
| 104 | //rp cReportTem plateDAO | |
| 105 | //St ring choic e = rpcCho iceTypeDes cribeDAO.r etrieveCho iceTypeDes cribe(divi sion, "GAD -7", entry ); | |
| 106 | Stri ng instrum ent = "GAD -7"; | |
| 107 | List <String> l ist = rpcR eportTempl ateDAO.ret rieveRepor tTemplate( division, instrument , duz); | |
| 108 | asse rtNotNull( list); | |
| 109 | ||
| 110 | //Sy stem.out.p rintln(lis t.size()); | |
| 111 | //Sy stem.out.p rintln(lis t); | |
| 112 | asse rtTrue(lis t.size() > = 1); | |
| 113 | } | |
| 114 | ||
| 115 | /* * | |
| 116 | * The Class MockRpcSe rviceUtil. | |
| 117 | * / | |
| 118 | cl ass MockRp cServiceUt il extends RpcServic eUtil { | |
| 119 | ||
| 120 | /** The Consta nt EOL. */ | |
| 121 | priv ate final static Str ing EOL = "\n"; | |
| 122 | ||
| 123 | /** The Consta nt data. * / | |
| 124 | priv ate final static Str ing data = | |
| 125 | "[DATA]" + EOL + | |
| 126 | "2 4173^1^212 ^Not at al l^1" + EOL + | |
| 127 | "2 4173^2^100 8^Several days^2" + EOL + | |
| 128 | "2 4173^3^100 9^More tha n half the days^3" + EOL + | |
| 129 | "2 4173^4^101 0^Nearly e very day^4 " + EOL + | |
| 130 | "2 4174^1^212 ^Not at al l^1" + EOL + | |
| 131 | "2 4174^2^100 8^Several days^2" + EOL + | |
| 132 | "2 4174^3^100 9^More tha n half the days^3" + EOL + | |
| 133 | "2 4174^4^101 0^Nearly e very day^4 " + EOL + | |
| 134 | "2 4175^1^212 ^Not at al l^1" + EOL + | |
| 135 | "2 4175^2^100 8^Several days^2" + EOL + | |
| 136 | "2 4175^3^100 9^More tha n half the days^3" + EOL + | |
| 137 | "2 4175^4^101 0^Nearly e very day^4 " + EOL + | |
| 138 | "2 4176^1^212 ^Not at al l^1" + EOL + | |
| 139 | "2 4176^2^100 8^Several days^2" + EOL + | |
| 140 | "2 4176^3^100 9^More tha n half the days^3" + EOL + | |
| 141 | "2 4176^4^101 0^Nearly e very day^4 " + EOL + | |
| 142 | "2 4177^1^212 ^Not at al l^1" + EOL + | |
| 143 | "2 4177^2^100 8^Several days^2" + EOL + | |
| 144 | "2 4177^3^100 9^More tha n half the days^3" + EOL + | |
| 145 | "2 4177^4^101 0^Nearly e very day^4 " + EOL + | |
| 146 | "2 4178^1^212 ^Not at al l^1" + EOL + | |
| 147 | "2 4178^2^100 8^Several days^2" + EOL + | |
| 148 | "2 4178^3^100 9^More tha n half the days^3" + EOL + | |
| 149 | "2 4178^4^101 0^Nearly e very day^4 " + EOL + | |
| 150 | "2 4179^1^212 ^Not at al l^1" + EOL + | |
| 151 | "2 4179^2^100 8^Several days^2" + EOL + | |
| 152 | "2 4179^3^100 9^More tha n half the days^3" + EOL + | |
| 153 | "2 4179^4^101 0^Nearly e very day^4 "; | |
| 154 | ||
| 155 | /* ( non-Javado c) | |
| 156 | * @ see gov.va .med.ciss. service.vi sta.RpcSer viceUtil#r unRpc(java .lang.Stri ng, java.l ang.String , java.uti l.List, go v.va.med.c iss.servic e.VistaCus tomization []) | |
| 157 | */ | |
| 158 | @Ove rride | |
| 159 | publ ic String runRpc(Str ing arg0, String arg 1, List<Ob ject> arg2 , | |
| 160 | VistaCus tomization ... arg3) throws RPC Exception { | |
| 161 | // TOD O Auto-gen erated met hod stub | |
| 162 | String result = data; | |
| 163 | return result; | |
| 164 | } | |
| 165 | ||
| 166 | /* ( non-Javado c) | |
| 167 | * @ see gov.va .med.ciss. service.vi sta.RpcSer viceUtil#s etLoggerCa llback(gov .va.med.ci ss.service .log.Logge rListener) | |
| 168 | */ | |
| 169 | @Ove rride | |
| 170 | publ ic void se tLoggerCal lback(Logg erListener loggerCal lback) { | |
| 171 | // TOD O Auto-gen erated met hod stub | |
| 172 | super. setLoggerC allback(lo ggerCallba ck); | |
| 173 | } | |
| 174 | ||
| 175 | /** | |
| 176 | * I nstantiate s a new mo ck rpc ser vice util. | |
| 177 | * | |
| 178 | * @ param conn Spec the c onn spec | |
| 179 | * @ param kaaj eeService the kaajee service | |
| 180 | * @ param vist aLinkServi ce the vis ta link se rvice | |
| 181 | */ | |
| 182 | publ ic MockRpc ServiceUti l(Connecti onSpec con nSpec, | |
| 183 | KaajeeSe rvice kaaj eeService, VistaLink Service vi staLinkSer vice) { | |
| 184 | super( connSpec, kaajeeServ ice, vista LinkServic e); | |
| 185 | // TOD O Auto-gen erated con structor s tub | |
| 186 | } | |
| 187 | } | |
| 188 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.