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\controller | UserAdminControllerTest.java | Wed Mar 27 19:21:15 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\controller | UserAdminControllerTest.java | Fri Mar 29 17:39:51 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 150 |
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 gov.va.med .ars.contr oller; | |
2 | ||
3 | import sta tic org.mo ckito.Matc hers.any; | |
4 | import sta tic org.mo ckito.Mock ito.times; | |
5 | import sta tic org.mo ckito.Mock ito.verify ; | |
6 | import sta tic org.mo ckito.Mock ito.verify NoMoreInte ractions; | |
7 | import sta tic org.mo ckito.Mock ito.when; | |
8 | import sta tic org.sp ringframew ork.test.w eb.servlet .request.M ockMvcRequ estBuilder s.post; | |
9 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tHandlers. print; | |
10 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tMatchers. status; | |
11 | ||
12 | import org .junit.Bef ore; | |
13 | import org .junit.Tes t; | |
14 | import org .junit.run ner.RunWit h; | |
15 | import org .mockito.I njectMocks ; | |
16 | import org .mockito.M atchers; | |
17 | import org .mockito.M ock; | |
18 | import org .mockito.M ockitoAnno tations; | |
19 | import org .mockito.r unners.Moc kitoJUnitR unner; | |
20 | import org .springfra mework.htt p.MediaTyp e; | |
21 | import org .springfra mework.tes t.web.serv let.MockMv c; | |
22 | import org .springfra mework.tes t.web.serv let.setup. MockMvcBui lders; | |
23 | ||
24 | import com .fasterxml .jackson.d atabind.Ob jectMapper ; | |
25 | import com .fasterxml .jackson.d atabind.Ob jectWriter ; | |
26 | import com .fasterxml .jackson.d atabind.Se rializatio nFeature; | |
27 | ||
28 | import gov .va.med.ar s.filter.C ORSFilter; | |
29 | import gov .va.med.ar s.model.re quest.User SearchRequ est; | |
30 | import gov .va.med.ar s.service. IUserAdmin Service; | |
31 | import jav afx.util.P air; | |
32 | ||
33 | @RunWith(M ockitoJUni tRunner.cl ass) | |
34 | public cla ss UserAdm inControll erTest { | |
35 | ||
36 | pr ivate Mock Mvc mockMv c; | |
37 | ||
38 | @M ock | |
39 | pr ivate IUse rAdminServ ice adminS ervice; | |
40 | ||
41 | @I njectMocks | |
42 | pr ivate User AdminContr oller admi nControlle r; | |
43 | ||
44 | @B efore | |
45 | pu blic void init() thr ows Except ion { | |
46 | Mock itoAnnotat ions.initM ocks(this) ; | |
47 | mock Mvc = Mock MvcBuilder s.standalo neSetup(ad minControl ler).addFi lters(new CORSFilter ()).build( ); | |
48 | } | |
49 | ||
50 | @S uppressWar nings("res triction") | |
51 | @T est | |
52 | pu blic void testCreate User() thr ows Except ion { | |
53 | ||
54 | User SearchRequ est reques t = new Us erSearchRe quest(); | |
55 | requ est.setAdm in("y"); | |
56 | requ est.setCre atedBy("AR S_ADMIN"); | |
57 | request.se tDomain(" DN S "); | |
58 | requ est.setSta tus("Y"); | |
59 | requ est.setEdi t("Y"); | |
60 | requ est.setExp ort("Y"); | |
61 | request.se tUserName( "
|
|
62 | ||
63 | Obje ctMapper m apper = ne w ObjectMa pper(); | |
64 | mapp er.configu re(Seriali zationFeat ure.FAIL_O N_EMPTY_BE ANS, false ); | |
65 | mapp er.configu re(Seriali zationFeat ure.WRAP_R OOT_VALUE, false); | |
66 | Obje ctWriter o w = mapper .writer(). withDefaul tPrettyPri nter(); | |
67 | Stri ng request BodyJson = ow.writeV alueAsStri ng(request ); | |
68 | ||
69 | when (adminServ ice.create User(any(U serSearchR equest.cla ss))).then Return(new Pair <Str ing,Boolea n>("User w as success fully crea ted.",true )); | |
70 | ||
71 | mock Mvc.perfor m(post("/a pi/v1/admi n/createUs er").conte ntType(Med iaType.APP LICATION_J SON) | |
72 | .content (requestBo dyJson)).a ndDo(print ()).andExp ect(status ().isCreat ed()); | |
73 | ||
74 | veri fy(adminSe rvice, tim es(1)).cre ateUser(Ma tchers.ref Eq(request )); | |
75 | veri fyNoMoreIn teractions (adminServ ice); | |
76 | } | |
77 | }*/ |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.