Produced by Araxis Merge on 4/27/2018 2:59:14 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 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\controller | AdditionalInfoRequestControllerTest.java | Tue Apr 24 14:49:58 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\controller | AdditionalInfoRequestControllerTest.java | Wed Apr 25 21:21:05 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 266 |
| 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.control ler; | |
| 2 | ||
| 3 | import sta tic org.ju nit.Assert .assertFal se; | |
| 4 | import sta tic org.sp ringframew ork.test.w eb.servlet .request.M ockMvcRequ estBuilder s.post; | |
| 5 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tHandlers. print; | |
| 6 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tMatchers. content; | |
| 7 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tMatchers. status; | |
| 8 | ||
| 9 | import jav a.math.Big Decimal; | |
| 10 | import jav a.util.Arr ayList; | |
| 11 | import jav a.util.Lis t; | |
| 12 | ||
| 13 | import org .apache.lo gging.log4 j.LogManag er; | |
| 14 | import org .apache.lo gging.log4 j.Logger; | |
| 15 | import org .junit.Bef ore; | |
| 16 | import org .junit.Tes t; | |
| 17 | import org .junit.run ner.RunWit h; | |
| 18 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 19 | import org .springfra mework.htt p.HttpStat us; | |
| 20 | import org .springfra mework.htt p.MediaTyp e; | |
| 21 | import org .springfra mework.tes t.context. ContextCon figuration ; | |
| 22 | import org .springfra mework.tes t.context. junit4.Spr ingJUnit4C lassRunner ; | |
| 23 | import org .springfra mework.tes t.context. web.WebApp Configurat ion; | |
| 24 | import org .springfra mework.tes t.web.serv let.MockMv c; | |
| 25 | import org .springfra mework.tes t.web.serv let.Result Actions; | |
| 26 | import org .springfra mework.tes t.web.serv let.setup. MockMvcBui lders; | |
| 27 | import org .springfra mework.web .context.W ebApplicat ionContext ; | |
| 28 | ||
| 29 | import com .fasterxml .jackson.d atabind.Ob jectMapper ; | |
| 30 | import com .fasterxml .jackson.d atabind.Ob jectWriter ; | |
| 31 | import com .fasterxml .jackson.d atabind.Se rializatio nFeature; | |
| 32 | ||
| 33 | import gov .va.med.ar s.configur ation.AppC onfig; | |
| 34 | import gov .va.med.ar s.configur ation.spri ng.SpringM vcConfig; | |
| 35 | import gov .va.med.ar s.model.re sponse.Rfa iLineItemR esponse; | |
| 36 | import gov .va.med.ar s.model.re sponse.Rfa iResponse; | |
| 37 | ||
| 38 | ||
| 39 | @WebAppCon figuration | |
| 40 | @RunWith(S pringJUnit 4ClassRunn er.class) | |
| 41 | @ContextCo nfiguratio n(classes = { AppCon fig.class, SpringMvc Config.cla ss }) | |
| 42 | public cla ss Additio nalInfoReq uestContro llerTest { | |
| 43 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(Addi tionalInfo RequestCon trollerTes t.class); | |
| 44 | ||
| 45 | @A utowired | |
| 46 | pr ivate WebA pplication Context wa c; | |
| 47 | pr ivate Mock Mvc mockMv c; | |
| 48 | ||
| 49 | @B efore | |
| 50 | pu blic void setup() { | |
| 51 | this .mockMvc = MockMvcBu ilders.web AppContext Setup(this .wac).buil d(); | |
| 52 | } | |
| 53 | ||
| 54 | @T est | |
| 55 | pu blic void testSubmit RfaiReques t_Success( ) throws E xception { | |
| 56 | Rfai Response r faiRequest = new Rfa iResponse( ); | |
| 57 | rfai Request.se tClaimId(1 0095L); | |
| 58 | rfaiReques t.setConta ctInformat ion(" PII "); | |
| 59 | rfai Request.se tServiceFr omDate("12 /12/2017") ; | |
| 60 | rfai Request.se tServiceTo Date("12/1 2/2017"); | |
| 61 | rfai Request.se tResponseD ate("12/12 /2017"); | |
| 62 | rfai Request.se tClaimStat us("R4"); | |
| 63 | rfai Request.se tLoincCode ("18842-5" ); | |
| 64 | rfai Request.se tLoincCode Modifier(" 18789-8"); | |
| 65 | ||
| 66 | List <RfaiLineI temRespons e> rfaiLin eItemRespo nse = new ArrayList< RfaiLineIt emResponse >(); | |
| 67 | Rfai LineItemRe sponse rfa iLine = ne w RfaiLine ItemRespon se(); | |
| 68 | rfai Line.setSe rviceLineI d(10095L); | |
| 69 | rfai Line.setCh argeAmount (new BigDe cimal(2.01 )); | |
| 70 | rfai Line.setMo difiers("m odifier"); | |
| 71 | rfai Line.setPr ocedureCod e("256"); | |
| 72 | rfai Line.setRe venueCode( "456"); | |
| 73 | rfai Line.setSe rviceFrom( "12/12/201 7"); | |
| 74 | rfai Line.setSe rviceTo("1 2/12/2017" ); | |
| 75 | rfai Line.setSe rviceLineI d(1000089L ); | |
| 76 | rfai LineItemRe sponse.add (rfaiLine) ; | |
| 77 | rfai Request.se tRfaiLineI temRespons e(rfaiLine ItemRespon se); | |
| 78 | ||
| 79 | Obje ctMapper m apper = ne w ObjectMa pper(); | |
| 80 | mapp er.configu re(Seriali zationFeat ure.WRAP_R OOT_VALUE, false); | |
| 81 | Obje ctWriter o w = mapper .writer(). withDefaul tPrettyPri nter(); | |
| 82 | ||
| 83 | Stri ng request Json = ow. writeValue AsString(r faiRequest ); | |
| 84 | ||
| 85 | Resu ltActions result = m ockMvc | |
| 86 | .perform ( | |
| 87 | po st("/api/v 1/addition alInfoRequ est").cont entType(Me diaType.AP PLICATION_ JSON).cont ent(reques tJson)) | |
| 88 | .andDo(p rint()).an dExpect(st atus().isC reated()) | |
| 89 | .andExpe ct(content ().content Type("appl ication/js on;charset =UTF-8")); | |
| 90 | logg er.info("g etMedicalC odesSucces s:" + resu lt.andRetu rn().getRe sponse().g etStatus() ); | |
| 91 | asse rtFalse(Ht tpStatus.C REATED.val ue() != re sult.andRe turn().get Response() .getStatus ()); | |
| 92 | } | |
| 93 | ||
| 94 | @T est | |
| 95 | pu blic void testSubmit RfaiReques t_Failure( ) throws E xception { | |
| 96 | Rfai Response r faiRequest = new Rfa iResponse( ); | |
| 97 | //rf aiRequest. setClaimId (10095L); | |
| 98 | rfaiReques t.setConta ctInformat ion(" PII "); | |
| 99 | rfai Request.se tServiceFr omDate("12 /12/2017") ; | |
| 100 | rfai Request.se tServiceTo Date("12/1 2/2017"); | |
| 101 | rfai Request.se tResponseD ate("12/12 /2017"); | |
| 102 | rfai Request.se tClaimStat us("R4"); | |
| 103 | rfai Request.se tLoincCode ("18842-5" ); | |
| 104 | rfai Request.se tLoincCode Modifier(" 18789-8"); | |
| 105 | ||
| 106 | List <RfaiLineI temRespons e> rfaiLin eItemRespo nse = new ArrayList< RfaiLineIt emResponse >(); | |
| 107 | Rfai LineItemRe sponse rfa iLine = ne w RfaiLine ItemRespon se(); | |
| 108 | rfai Line.setSe rviceLineI d(10095L); | |
| 109 | rfai Line.setCh argeAmount (new BigDe cimal(2.01 )); | |
| 110 | rfai Line.setMo difiers("m odifier"); | |
| 111 | rfai Line.setPr ocedureCod e("256"); | |
| 112 | rfai Line.setRe venueCode( "456"); | |
| 113 | rfai Line.setSe rviceFrom( "12/12/201 7"); | |
| 114 | rfai Line.setSe rviceTo("1 2/12/2017" ); | |
| 115 | rfai Line.setSe rviceLineI d(1000089L ); | |
| 116 | rfai LineItemRe sponse.add (rfaiLine) ; | |
| 117 | rfai Request.se tRfaiLineI temRespons e(rfaiLine ItemRespon se); | |
| 118 | ||
| 119 | Obje ctMapper m apper = ne w ObjectMa pper(); | |
| 120 | mapp er.configu re(Seriali zationFeat ure.WRAP_R OOT_VALUE, false); | |
| 121 | Obje ctWriter o w = mapper .writer(). withDefaul tPrettyPri nter(); | |
| 122 | ||
| 123 | Stri ng request Json = ow. writeValue AsString(r faiRequest ); | |
| 124 | ||
| 125 | Resu ltActions result = m ockMvc | |
| 126 | .perform ( | |
| 127 | po st("/api/v 1/addition alInfoRequ est").cont entType(Me diaType.AP PLICATION_ JSON).cont ent(reques tJson)) | |
| 128 | .andDo(p rint()).an dExpect(st atus().isB adRequest( )) | |
| 129 | .andExpe ct(content ().content Type("appl ication/js on;charset =UTF-8")); | |
| 130 | logg er.info("g etMedicalC odesSucces s:" + resu lt.andRetu rn().getRe sponse().g etStatus() ); | |
| 131 | asse rtFalse(Ht tpStatus.B AD_REQUEST .value() ! = result.a ndReturn() .getRespon se().getSt atus()); | |
| 132 | } | |
| 133 | ||
| 134 | ||
| 135 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.