Produced by Araxis Merge on 10/3/2017 11:16:02 AM 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 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\endpoints\writeback-endpoint | writeback-endpoint-middleware-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\endpoints\writeback-endpoint | writeback-endpoint-middleware-spec.js | Tue Oct 3 13:15:21 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 164 |
| Changed | 1 | 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 | 'use stric t'; | |
| 2 | ||
| 3 | require('. ./../../.. /env-setup '); | |
| 4 | ||
| 5 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 6 | // NOTE: b e sure nex t lines ar e commente d out befo re pushing | |
| 7 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 8 | // log = l ogUtil._cr eateLogger ({ | |
| 9 | // nam e: 'test', | |
| 10 | // lev el: 'debug ', | |
| 11 | // chi ld: logUti l._createL ogger | |
| 12 | // }); | |
| 13 | ||
| 14 | var DummyR equest = r equire(glo bal.VX_ROO T + 'tests /frames/du mmy-reques t'); | |
| 15 | var JdsCli entDummy = require(g lobal.VX_D UMMIES + ' jds-client -dummy'); | |
| 16 | var proces sWriteback = require (global.VX _ENDPOINTS + 'writeb ack/writeb ack-endpoi nt-middlew are'); | |
| 17 | ||
| 18 | describe(' writeback- endpoint-m iddleware' , function (){ | |
| 19 | de scribe('pr ocessWrite back', fun ction(){ | |
| 20 | it(' sends writ eback data to jds an d solr', f unction(do ne){ | |
| 21 | var conf ig = { | |
| 22 | vist aSites: { | |
| 23 | '9E7A': {} , | |
| 24 | 'C877': {} | |
| 25 | }, | |
| 26 | vist a: { | |
| 27 | domains NoSolrTrac king: [] | |
| 28 | }, | |
| 29 | jds: { | |
| 30 | protocol: 'http', | |
| 31 | host: ' IP ', | |
| 32 | port: REDACTED | |
| 33 | } | |
| 34 | }; | |
| 35 | spyOn(lo g, 'child' ).andCallT hrough(); | |
| 36 | var env = { | |
| 37 | publ isherRoute r: { | |
| 38 | publish: j asmine.cre ateSpy().a ndCallFake (function( job, callb ack) { cal lback(); } ) | |
| 39 | }, | |
| 40 | jds: new JdsCl ientDummy( log, confi g), | |
| 41 | metr ics: log, | |
| 42 | solr : { | |
| 43 | add: funct ion (recor d, callbac k) { callb ack(); }, | |
| 44 | childInsta nce: funct ion () { r eturn env. solr; } | |
| 45 | } | |
| 46 | }; | |
| 47 | ||
| 48 | env.jds. _setRespon seData(nul l, | |
| 49 | [ | |
| 50 | { | |
| 51 | status Code: 200 | |
| 52 | }, | |
| 53 | { | |
| 54 | status Code: 201 | |
| 55 | } | |
| 56 | ], | |
| 57 | null ); | |
| 58 | env.publ isherRoute r.childIns tance = fu nction() { return en v.publishe rRouter; } ; | |
| 59 | var re q = new Du mmyRequest ({ | |
| 60 | 'pid ': '9E7A;3 ' | |
| 61 | }); | |
| 62 | req.body = { | |
| 63 | 'pid ': '9E7A;3 ', | |
| 64 | 'uid ': 'urn:va :allergy:9 E7A:3:12', | |
| 65 | 'las tUpdateTim e': '20150 317200936' | |
| 66 | }; | |
| 67 | req.head ers = { | |
| 68 | 'x-s ession-id' : 'session Id', | |
| 69 | 'x-r equest-id' : 'request Id' | |
| 70 | }; | |
| 71 | var res = { | |
| 72 | stat us: jasmin e.createSp y().andCal lFake(func tion() { r eturn res; }), | |
| 73 | send : jasmine. createSpy( ), | |
| 74 | json : jasmine. createSpy( ) | |
| 75 | }; | |
| 76 | processW riteback(l og, config , env, req , res, fun ction() { | |
| 77 | expe ct(log.chi ld).toHave BeenCalled With(jasmi ne.objectC ontaining( {sessionId : 'session Id'})); | |
| 78 | expe ct(res.sta tus).toHav eBeenCalle dWith(200) ; | |
| 79 | expe ct(res.jso n).toHaveB eenCalledW ith(jasmin e.objectCo ntaining({ uid: 'urn: va:allergy :9E7A:3:12 '})); | |
| 80 | done (); | |
| 81 | }); | |
| 82 | }); | |
| 83 | }) ; | |
| 84 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.