Produced by Araxis Merge on 3/1/2018 12:13:14 PM Central 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 | ehealth_xchange_cif.zip\NHIN_adapter\AdapterDataQualityServices\AdapterDataQualityServicesEJB\src\test\java\gov\va\med\nhin\adapter\dataquality\dh | DHUploadTest.java | Thu Feb 22 14:19:38 2018 UTC |
| 2 | ehealth_xchange_cif.zip\NHIN_adapter\AdapterDataQualityServices\AdapterDataQualityServicesEJB\src\test\java\gov\va\med\nhin\adapter\dataquality\dh | DHUploadTest.java | Tue Feb 27 19:50:30 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 166 |
| Changed | 3 | 6 |
| 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.n hin.adapte r.dataqual ity.dh; | |
| 2 | ||
| 3 | import sta tic com.gi thub.tomak ehurst.wir emock.clie nt.WireMoc k.*; | |
| 4 | import com .github.to makehurst. wiremock.j unit.WireM ockRule; | |
| 5 | import gov .va.med.nh in.adapter .dataquali ty.common. RestClient Exception; | |
| 6 | ||
| 7 | import jav a.io.IOExc eption; | |
| 8 | import jav a.io.Input Stream; | |
| 9 | import jav a.net.URIS yntaxExcep tion; | |
| 10 | import jav a.net.URL; | |
| 11 | import jav a.nio.char set.Standa rdCharsets ; | |
| 12 | ||
| 13 | import org .apache.co mmons.io.I OUtils; | |
| 14 | ||
| 15 | import sta tic org.ju nit.Assert .*; | |
| 16 | import org .junit.Rul e; | |
| 17 | import org .junit.Tes t; | |
| 18 | ||
| 19 | /** | |
| 20 | * | |
| 21 | * @author cbarber | |
| 22 | */ | |
| 23 | public cla ss DHUploa dTest | |
| 24 | { | |
| 25 | pu blic stati c final in t MOCK_POR T = PORT ; | |
| 26 | @R ule | |
| 27 | pu blic WireM ockRule wi reMockRule = new Wir eMockRule( MOCK_PORT) ; // No-ar gs constru ctor defau lts to por t PORT | |
| 28 | ||
| 29 | pu blic DHUpl oadTest() | |
| 30 | { | |
| 31 | } | |
| 32 | ||
| 33 | @T est | |
| 34 | pu blic void testUpload Doc() thro ws IOExcep tion, URIS yntaxExcep tion, Rest ClientExce ption | |
| 35 | { | |
| 36 | URL sampleResp Rsrc = get Class().ge tResource( "/GoodUplo adResponse .json"); | |
| 37 | Syst em.out.pri ntln("samp leRespRsrc : "+sample RespRsrc); | |
| 38 | asse rtNotEqual s(null,sam pleRespRsr c); | |
| 39 | Stri ng sampleR espString = IOUtils. toString(s ampleRespR src.toURI( ), Standar dCharsets. UTF_8); | |
| 40 | stub For( | |
| 41 | post(u rlMatching ("/documen t.*")) | |
| 42 | .withH eader("Acc ept", equa lTo("appli cation/jso n")) | |
| 43 | .willR eturn( | |
| 44 | aRespons e() | |
| 45 | .withSta tus(200) | |
| 46 | .withHea der("Conte nt-Type", "applicati on/json") | |
| 47 | .withBod y(sampleRe spString) | |
| 48 | ) | |
| 49 | ); | |
| 50 | ||
| 51 | Inpu tStream do cInput = g etClass(). getResourc eAsStream( "/374117_C CDACCD_201 61202.xml" ); | |
| 52 | Syst em.out.pri ntln("docI nput: "+do cInput); | |
| 53 | asse rtNotEqual s(null,doc Input); | |
| 54 | DHUp load dhUpl oader = ne w DHUpload (); | |
| 55 | Syst em.out.pri ntln("DHUp load uploa dDoc() att empting to upload fi le to DH w iremock: " +"374117_C CDACCD_201 61202.xml" ); | |
| 56 | ||
| 57 | Stri ng returne dId = dhUp loader.upl oadDoc( | |
| 58 | "http: //localhos t:" + MOCK _PORT, | |
| 59 | "docum ent", | |
| 60 | "chuck y", | |
| 61 | "let-m e-in", | |
| 62 | "someF ileName", | |
| 63 | docInp ut, 10, 10 ); | |
| 64 | Syst em.out.pri ntln("DHUp load uploa dDoc() ret urned ID: "+returned Id); | |
| 65 | asse rtEquals(" 573614a4c8 ff93f01889 2496", ret urnedId); | |
| 66 | ||
| 67 | veri fy(postReq uestedFor( urlMatchin g("/docume nt.*")) | |
| 68 | .withR equestBody (matching( ".*<Clinic alDocument xmlns=\"u rn:hl7-org :v3\".*")) | |
| 69 | .withH eader("Con tent-Type" , matching ("applicat ion/xml")) ); | |
| 70 | } | |
| 71 | ||
| 72 | // @Test | |
| 73 | pu blic void testCloudS erver() th rows IOExc eption, UR ISyntaxExc eption, Re stClientEx ception | |
| 74 | { | |
| 75 | Inpu tStream do cInput = g etClass(). getResourc eAsStream( "374117_CC DACCD_2016 1202.xml") ; | |
| 76 | DHUp load dhUpl oader = ne w DHUpload (); | |
| 77 | Stri ng returne dId = dhUp loader.upl oadDoc( | |
| 78 | "https ://va-api. diameterhe alth.com", | |
| 79 | "docum ent", | |
| 80 | "REPLACE W HEN TESTIN G@ DOMAIN ", | |
| 81 | "REPLA CE WHEN TE STING", | |
| 82 | "37411 7_CCDACCD_ 20161202.x ml", | |
| 83 | docInp ut, 10, 10 ); | |
| 84 | Syst em.err.pri ntln("Got back doc I D " + retu rnedId); | |
| 85 | } | |
| 86 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.