Produced by Araxis Merge on 3/12/2019 4:22:12 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\CC CC SEOC 1.7\seocapi-release1.7@25b9376983d\seoc-reactor\seoc-rest-api\src\test\java\gov\va\oneconsult\seoc\api\model | SeocTest.java | Wed Jan 30 19:31:26 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\Community Care Care Coordination SEOC 1.7-redacted\CC CC SEOC 1.7\seocapi-release1.7@25b9376983d\seoc-reactor\seoc-rest-api\src\test\java\gov\va\oneconsult\seoc\api\model | SeocTest.java | Tue Mar 12 20:37:46 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 1 | 1364 |
Changed | 0 | 0 |
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 | /* | |
2 | * SeocTes t.java | |
3 | * Copyrig ht (c) 201 7 Veterans Affairs. | |
4 | */ | |
5 | package go v.va.oneco nsult.seoc .api.model ; | |
6 | ||
7 | import sta tic org.as sertj.core .api.Asser tions.asse rtThat; | |
8 | ||
9 | import jav a.util.Arr ayList; | |
10 | import jav a.util.Cal endar; | |
11 | import jav a.util.Dat e; | |
12 | import jav a.util.Has hSet; | |
13 | import jav a.util.Lis t; | |
14 | import jav a.util.Set ; | |
15 | ||
16 | import jav ax.validat ion.Constr aintViolat ion; | |
17 | import jav ax.validat ion.Valida tion; | |
18 | import jav ax.validat ion.Valida tor; | |
19 | import jav ax.validat ion.Valida torFactory ; | |
20 | ||
21 | import org .junit.Bef ore; | |
22 | import org .junit.Tes t; | |
23 | ||
24 | import gov .va.onecon sult.seoc. api.contro ller.SeocO bjectGener ator; | |
25 | import gov .va.onecon sult.seoc. api.util.A piUtil; | |
26 | import gov .va.onecon sult.seoc. api.util.C onstants; | |
27 | ||
28 | /** | |
29 | * Test ca ses for Se oc model o bject | |
30 | * | |
31 | * @author AbleVets | |
32 | */ | |
33 | public cla ss SeocTes t | |
34 | { | |
35 | ||
36 | Se rviceLine sl = new S erviceLine (); | |
37 | ||
38 | St atus draft = new Sta tus(); | |
39 | St atus activ e = new St atus(); | |
40 | ||
41 | Pa yableServi ce serv1 = new Payab leService( ); | |
42 | Pa yableServi ce serv2 = new Payab leService( ); | |
43 | Pa yableServi ce serv3 = new Payab leService( ); | |
44 | Pa yableServi ce serv4 = new Payab leService( ); | |
45 | ||
46 | Bi llingCode bc1 = new BillingCod e(); | |
47 | Bi llingCode bc2 = new BillingCod e(); | |
48 | ||
49 | pr ivate Vali dator vali dator; | |
50 | /* * | |
51 | * Descripti on: Setup before run ning the t est case | |
52 | * / | |
53 | @B efore | |
54 | pu blic void setUp() | |
55 | { | |
56 | sl.s etDescript ion("TestS erviceLine "); | |
57 | sl.s etId(1); | |
58 | sl.s etServiceA bbreviatio n("SLABBR" ); | |
59 | ||
60 | draf t.setId(1) ; | |
61 | draf t.setDescr iption("Dr aft"); | |
62 | ||
63 | acti ve.setId(2 ); | |
64 | acti ve.setDesc ription("A ctive"); | |
65 | ||
66 | // b illing cod es | |
67 | bc1. setId(1); | |
68 | bc1. setBilling Code("Bc1" ); | |
69 | bc1. setPrecert Required(f alse); | |
70 | ||
71 | bc2. setId(2); | |
72 | bc2. setBilling Code("Bc2" ); | |
73 | bc2. setPrecert Required(t rue); | |
74 | ||
75 | Set< BillingCod e> bcs = n ew HashSet <BillingCo de>(); | |
76 | bcs. add(bc1); | |
77 | bcs. add(bc2); | |
78 | ||
79 | // Ser vice with billing co des | |
80 | serv 1.setId(1) ; | |
81 | serv 1.setDescr iption("se rvice1"); | |
82 | serv 1.setBilli ngCodes(bc s); | |
83 | ||
84 | // Ser vice with no billing codes | |
85 | serv 2.setId(2) ; | |
86 | serv 2.setDescr iption("se rvice2"); | |
87 | ||
88 | // Ser vice with codeRequir ed "NO" | |
89 | serv 3.setId(3) ; | |
90 | serv 3.setDescr iption("se rvice3"); | |
91 | serv 3.setCodeR equired("N O"); | |
92 | ||
93 | // Ser vice with codeRequir ed "ANY" | |
94 | serv 4.setId(4) ; | |
95 | serv 4.setDescr iption("se rvice4"); | |
96 | serv 4.setCodeR equired("A NY"); | |
97 | ||
98 | Vali datorFacto ry validat orFactory = Validati on.buildDe faultValid atorFactor y(); | |
99 | va lidator = validatorF actory.get Validator( ); | |
100 | ||
101 | } | |
102 | ||
103 | /* * | |
104 | * Descripti on: Check validity o f seoc tit le when th e status i s 'draft' | |
105 | * / | |
106 | @T est | |
107 | pu blic void checkSeocI dForDraft( ) | |
108 | { | |
109 | Seoc draftSeoc = new Seo c(); | |
110 | draf tSeoc.setI d(1); | |
111 | draf tSeoc.setN ame("SeocT est"); | |
112 | draf tSeoc.setS erviceLine (sl); | |
113 | draf tSeoc.setS tatus(draf t); | |
114 | ||
115 | Stri ng expecte dSeocId = "SLABBR_Se ocTest"; | |
116 | ||
117 | asse rtThat(exp ectedSeocI d.toUpperC ase()).isE qualTo(dra ftSeoc.get SeocId()); | |
118 | } | |
119 | ||
120 | /* * | |
121 | * Descripti on: Check validity o f Seoc tit le when th e Seoc is PAL | |
122 | * / | |
123 | @T est | |
124 | pu blic void checkSeocI dWithPal() | |
125 | { | |
126 | Seoc seocWithP al = new S eoc(); | |
127 | seoc WithPal.se tName("Seo cTest"); | |
128 | seoc WithPal.se tVersionNu mber("1.0. 1"); | |
129 | seoc WithPal.se tServiceLi ne(sl); | |
130 | seoc WithPal.se tStatus(ac tive); | |
131 | seoc WithPal.se tPal(true) ; | |
132 | List <PayableSe rvice> ser vices = ne w ArrayLis t<PayableS ervice>(); | |
133 | serv ices.add(s erv2); | |
134 | seoc WithPal.se tServices( services); | |
135 | ||
136 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 _PAL"; | |
137 | ||
138 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithPal.get SeocId()); | |
139 | } | |
140 | ||
141 | /* * | |
142 | * Descripti on: Check validity o f Seoc tit le when th e Seoc is not PAL | |
143 | * / | |
144 | @T est | |
145 | pu blic void checkSeocI dWithNoPal () | |
146 | { | |
147 | Seoc seocWithN oPal = new Seoc(); | |
148 | seoc WithNoPal. setName("S eocTest"); | |
149 | seoc WithNoPal. setVersion Number("1. 0.1"); | |
150 | seoc WithNoPal. setService Line(sl); | |
151 | seoc WithNoPal. setStatus( active); | |
152 | seoc WithNoPal. setPal(fal se); | |
153 | ||
154 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 "; | |
155 | ||
156 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithNoPal.g etSeocId() ); | |
157 | } | |
158 | ||
159 | /* * | |
160 | * Descripti on: Check validity o f Seoc tit le when th e Seoc is PAL. At le ast one | |
161 | * billing c ode is Pre cert. | |
162 | * / | |
163 | @T est | |
164 | pu blic void checkSeocP alPrecert( ) | |
165 | { | |
166 | Seoc seocWithP alPrecert = new Seoc (); | |
167 | seoc WithPalPre cert.setNa me("SeocTe st"); | |
168 | seoc WithPalPre cert.setVe rsionNumbe r("1.0.1") ; | |
169 | seoc WithPalPre cert.setSe rviceLine( sl); | |
170 | seoc WithPalPre cert.setSt atus(activ e); | |
171 | seoc WithPalPre cert.setPa l(true); | |
172 | List <PayableSe rvice> ser vices = ne w ArrayLis t<PayableS ervice>(); | |
173 | serv ices.add(s erv1); | |
174 | seoc WithPalPre cert.setSe rvices(ser vices); | |
175 | ||
176 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 _PAL_PRCT" ; | |
177 | ||
178 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithPalPrec ert.getSeo cId()); | |
179 | } | |
180 | ||
181 | /** | |
182 | * Descr iption: Ch eck validi ty of Seoc title whe n the serv ice is mar ked as | |
183 | * No Co des Requir ed. | |
184 | */ | |
185 | @Test | |
186 | public v oid checkS eocNoCodeR equired() | |
187 | { | |
188 | Seoc seocWithP alPrecert = new Seoc (); | |
189 | seoc WithPalPre cert.setNa me("SeocTe st"); | |
190 | seoc WithPalPre cert.setVe rsionNumbe r("1.0.1") ; | |
191 | seoc WithPalPre cert.setSe rviceLine( sl); | |
192 | seoc WithPalPre cert.setSt atus(activ e); | |
193 | seoc WithPalPre cert.setPa l(true); | |
194 | List<P ayableServ ice> servi ces = new ArrayList< PayableSer vice>(); | |
195 | serv ices.add(s erv3); | |
196 | seoc WithPalPre cert.setSe rvices(ser vices); | |
197 | ||
198 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 _PAL_PRCT" ; | |
199 | ||
200 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithPalPrec ert.getSeo cId()); | |
201 | } | |
202 | ||
203 | /** | |
204 | * Descr iption: Ch eck validi ty of Seoc title whe n the serv ice is mar ked as | |
205 | * Any C ode Accept ed. | |
206 | */ | |
207 | @Test | |
208 | public v oid checkS eocAnyCode Accepted() | |
209 | { | |
210 | Seoc seocWithP alPrecert = new Seoc (); | |
211 | seoc WithPalPre cert.setNa me("SeocTe st"); | |
212 | seoc WithPalPre cert.setVe rsionNumbe r("1.0.1") ; | |
213 | seoc WithPalPre cert.setSe rviceLine( sl); | |
214 | seoc WithPalPre cert.setSt atus(activ e); | |
215 | seoc WithPalPre cert.setPa l(true); | |
216 | Li st<Payable Service> s ervices = new ArrayL ist<Payabl eService>( ); | |
217 | serv ices.add(s erv4); | |
218 | seoc WithPalPre cert.setSe rvices(ser vices); | |
219 | ||
220 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 _PAL_PRCT" ; | |
221 | ||
222 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithPalPrec ert.getSeo cId()); | |
223 | } | |
224 | ||
225 | /* * | |
226 | * Descripti on: Check validity o f Seoc tit le when th e Seoc is not PAL. A t least | |
227 | * one billi ng code is Precert | |
228 | * / | |
229 | @T est | |
230 | pu blic void checkSeocP recertNoPa l() | |
231 | { | |
232 | Seoc seocWithP recertNoPa l = new Se oc(); | |
233 | seoc WithPrecer tNoPal.set Name("Seoc Test"); | |
234 | seoc WithPrecer tNoPal.set VersionNum ber("1.0.1 "); | |
235 | seoc WithPrecer tNoPal.set ServiceLin e(sl); | |
236 | seoc WithPrecer tNoPal.set Status(act ive); | |
237 | seoc WithPrecer tNoPal.set Pal(false) ; | |
238 | List <PayableSe rvice> ser vices = ne w ArrayLis t<PayableS ervice>(); | |
239 | serv ices.add(s erv1); | |
240 | seoc WithPrecer tNoPal.set Services(s ervices); | |
241 | ||
242 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 _PRCT"; | |
243 | ||
244 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocW ithPrecert NoPal.getS eocId()); | |
245 | } | |
246 | ||
247 | /* * | |
248 | * Descripti on: Check validity o f Seoc tit le when th e Seoc is not PAL. A t least | |
249 | * one billi ng code of Precert i s not foun d. | |
250 | * / | |
251 | @T est | |
252 | pu blic void checkSeocN oPalNoPrec ert() | |
253 | { | |
254 | Seoc seocNoPal NoPrecert = new Seoc (); | |
255 | seoc NoPalNoPre cert.setNa me("SeocTe st"); | |
256 | seoc NoPalNoPre cert.setVe rsionNumbe r("1.0.1") ; | |
257 | seoc NoPalNoPre cert.setSe rviceLine( sl); | |
258 | seoc NoPalNoPre cert.setSt atus(activ e); | |
259 | seoc NoPalNoPre cert.setPa l(false); | |
260 | List <PayableSe rvice> ser vices = ne w ArrayLis t<PayableS ervice>(); | |
261 | serv ices.add(s erv2); | |
262 | seoc NoPalNoPre cert.setSe rvices(ser vices); | |
263 | ||
264 | Stri ng expecte dSeoc = "S LABBR_Seoc Test_1.0.1 "; | |
265 | ||
266 | asse rtThat(exp ectedSeoc. toUpperCas e()).isEqu alTo(seocN oPalNoPrec ert.getSeo cId()); | |
267 | } | |
268 | ||
269 | /* * | |
270 | * Descripti on: After cloning th e seoc att ributes ch anged on t he clone a re not aff ecting the main copy of clone. | |
271 | * / | |
272 | @T est | |
273 | pu blic void deepClone_ nonRecursi veProperti es() | |
274 | { | |
275 | Seoc thatSeoc = new Seoc (); | |
276 | Date activated Date = Api Util.conve rtStringTo Date("09-0 4-2018 07: 34:05 AM") ; | |
277 | Date discontDa te = ApiUt il.convert StringToDa te("09-04- 2018 07:34 :05 AM"); | |
278 | Date effective Date = Api Util.conve rtStringTo Date("09-0 4-2018 07: 34:05 AM") ; | |
279 | Date endDate = ApiUtil.c onvertStri ngToDate(" 09-04-2018 07:34:05 AM"); | |
280 | ||
281 | that Seoc.setSe ocKey(1); | |
282 | that Seoc.setNa me("Seoc T est"); | |
283 | that Seoc.setVe rsionNumbe r("1.0.1") ; | |
284 | that Seoc.setEf fectiveDat e(effectiv eDate); | |
285 | that Seoc.setEn dDate(endD ate); | |
286 | that Seoc.setDi sclaimer(" Disclaimer 1"); | |
287 | that Seoc.setDu ration(5); | |
288 | that Seoc.setDe scription( "Descripti on1"); | |
289 | that Seoc.setPa l(true); | |
290 | that Seoc.setPr oceduralOv erview("Pr oceduralOv erview1"); | |
291 | that Seoc.setMa xAllowable Visits(5); | |
292 | that Seoc.setAc tivatedTim estamp(act ivatedDate ); | |
293 | that Seoc.setAc tivatedBy( "SystemNam e"); | |
294 | that Seoc.setDi scontinued Timestamp( discontDat e); | |
295 | that Seoc.setDi scontinued By("System Name"); | |
296 | that Seoc.setSt atus(SeocO bjectGener ator.dateh old); | |
297 | that Seoc.setCa tegoryOfCa re(SeocObj ectGenerat or.cc1); | |
298 | that Seoc.setSe rviceLine( SeocObject Generator. sl1); | |
299 | that Seoc.setQa sp(SeocObj ectGenerat or.qasp1); | |
300 | that Seoc.setSe rvices(new ArrayList <PayableSe rvice>()); | |
301 | ||
302 | Seoc thisSeoc = thatSeoc .deepClone (); | |
303 | ||
304 | this Seoc.setSe ocKey(1); | |
305 | this Seoc.setNa me("Seoc T est1"); | |
306 | this Seoc.setVe rsionNumbe r(Constant s.VERSION_ PENDING_RE VISION); | |
307 | this Seoc.setEf fectiveDat e(new Date ()); | |
308 | this Seoc.setEn dDate(new Date()); | |
309 | this Seoc.setDi sclaimer(" Disclaimer 2"); | |
310 | this Seoc.setDu ration(6); | |
311 | this Seoc.setDe scription( "Descripti on2"); | |
312 | this Seoc.setPa l(false); | |
313 | this Seoc.setPr oceduralOv erview("Pr oceduralOv erview2"); | |
314 | this Seoc.setMa xAllowable Visits(6); | |
315 | this Seoc.setAc tivatedTim estamp(new Date()); | |
316 | this Seoc.setAc tivatedBy( "System"); | |
317 | this Seoc.setDi scontinued Timestamp( new Date() ); | |
318 | this Seoc.setDi scontinued By("System "); | |
319 | this Seoc.setSt atus(SeocO bjectGener ator.inpro gress); | |
320 | this Seoc.setCa tegoryOfCa re(SeocObj ectGenerat or.cc2); | |
321 | this Seoc.setSe rviceLine( SeocObject Generator. sl2); | |
322 | this Seoc.setQa sp(SeocObj ectGenerat or.qasp2); | |
323 | this Seoc.setSe rvices(new ArrayList <PayableSe rvice>()); | |
324 | ||
325 | ||
326 | asse rtThat(thi sSeoc.getN ame()).isN otEqualTo( thatSeoc.g etName()); | |
327 | asse rtThat(thi sSeoc.getV ersionNumb er()).isNo tEqualTo(t hatSeoc.ge tVersionNu mber()); | |
328 | asse rtThat(thi sSeoc.getE ffectiveDa te()).isNo tEqualTo(t hatSeoc.ge tEffective Date()); | |
329 | asse rtThat(thi sSeoc.getE ndDate()). isNotEqual To(thatSeo c.getEndDa te()); | |
330 | asse rtThat(thi sSeoc.getD isclaimer( )).isNotEq ualTo(that Seoc.getDi sclaimer() ); | |
331 | asse rtThat(thi sSeoc.getD uration()) .isNotEqua lTo(thatSe oc.getDura tion()); | |
332 | asse rtThat(thi sSeoc.getD escription ()).isNotE qualTo(tha tSeoc.getD escription ()); | |
333 | asse rtThat(thi sSeoc.getP al()).isNo tEqualTo(t hatSeoc.ge tPal()); | |
334 | asse rtThat(thi sSeoc.getP roceduralO verview()) .isNotEqua lTo(thatSe oc.getProc eduralOver view()); | |
335 | asse rtThat(thi sSeoc.getM axAllowabl eVisits()) .isNotEqua lTo(thatSe oc.getMaxA llowableVi sits()); | |
336 | asse rtThat(thi sSeoc.getA ctivatedTi mestamp()) .isNotEqua lTo(thatSe oc.getActi vatedTimes tamp()); | |
337 | asse rtThat(thi sSeoc.getA ctivatedBy ()).isNotE qualTo(tha tSeoc.getA ctivatedBy ()); | |
338 | asse rtThat(thi sSeoc.getD iscontinue dTimestamp ()).isNotE qualTo(tha tSeoc.getD iscontinue dTimestamp ()); | |
339 | asse rtThat(thi sSeoc.getD iscontinue dBy()).isN otEqualTo( thatSeoc.g etDisconti nuedBy()); | |
340 | asse rtThat(thi sSeoc.getS tatus()).i sNotEqualT o(thatSeoc .getStatus ()); | |
341 | asse rtThat(thi sSeoc.getC ategoryOfC are()).isN otEqualTo( thatSeoc.g etCategory OfCare()); | |
342 | asse rtThat(thi sSeoc.getQ asp()).isN otEqualTo( thatSeoc.g etQasp()); | |
343 | ||
344 | } | |
345 | ||
346 | /* * | |
347 | * Descripti on: Deep c lone recur sively clo ned embedd ed objects and they are referr ing to dif ferent ins tances of objects. | |
348 | * / | |
349 | @T est | |
350 | pu blic void deepClone_ recursiveP roperties( ) | |
351 | { | |
352 | Seoc thatSeoc = new Seoc (); | |
353 | ||
354 | that Seoc.setSe ocKey(1); | |
355 | that Seoc.setNa me("Seoc T est"); | |
356 | ||
357 | Paya bleService ps1 = new PayableSe rvice(); | |
358 | Paya bleService ps2 = new PayableSe rvice(); | |
359 | ||
360 | ps1. setDescrip tion("Paya bleService 11"); | |
361 | ps2. setDescrip tion("Paya bleService 12"); | |
362 | ||
363 | List <PayableSe rvice> psL ist = new ArrayList< PayableSer vice>(); | |
364 | psLi st.add(ps1 ); | |
365 | psLi st.add(ps2 ); | |
366 | that Seoc.setSe rvices(psL ist); | |
367 | ||
368 | Seoc thisSeoc = thatSeoc .deepClone (); | |
369 | ||
370 | asse rtThat(tha tSeoc.getS ervices()) .size().is EqualTo(2) ; | |
371 | asse rtThat(thi sSeoc.getS ervices()) .size().is EqualTo(2) ; | |
372 | ||
373 | that Seoc.getSe rvices().f orEach(s - > { | |
374 | assert That(thisS eoc.getSer vices()).d oesNotCont ain(s); | |
375 | }); | |
376 | ||
377 | } | |
378 | ||
379 | /* * | |
380 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Miss ing Seoc a ttributes | |
381 | * / | |
382 | @T est | |
383 | public void vali dationFail edInSeocFi elds() | |
384 | { | |
385 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, n ull, null, null, nul l, null, n ull, null, null, nul l, null, n ull, | |
386 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1, new ArrayList< PayableSer vice>()); | |
387 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, "descri ption", nu ll, null, 9, "YES", null, null , SeocObje ctGenerato r.cs1, tes tSeoc); | |
388 | test Seoc.getSe rvices().a dd(service 1); | |
389 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
390 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
391 | as sertThat(v iolations. size()).is EqualTo(7) ; | |
392 | ||
393 | } | |
394 | ||
395 | ||
396 | /* * | |
397 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Miss ing Seoc a ttributes | |
398 | * / | |
399 | @T est | |
400 | public void vali dationChec kNullMaxVi sitsAllowe d() | |
401 | { | |
402 | Inte ger maxVis its = null ; | |
403 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, n ull, null, null, nul l, null, m axVisits, null, null , null, nu ll, null, | |
404 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1, new ArrayList< PayableSer vice>()); | |
405 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, "descri ption", nu ll, null, 9, "YES", null, null , SeocObje ctGenerato r.cs1, tes tSeoc); | |
406 | test Seoc.getSe rvices().a dd(service 1); | |
407 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
408 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
409 | as sertThat(v iolations. size()).is EqualTo(7) ; | |
410 | ||
411 | } | |
412 | ||
413 | /* * | |
414 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Null Service | |
415 | * / | |
416 | @T est | |
417 | public void vali dationFail edDueToNoS ervices() | |
418 | { | |
419 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", 5 , null, nu ll, null, | |
420 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.da tehold, Se ocObjectGe nerator.qa sp1, null) ; | |
421 | Set< Hptc> hptc s = new Ha shSet<Hptc >(); | |
422 | hptc s.add(Seoc ObjectGene rator.hptc 1); | |
423 | test Seoc.setHp tcs(hptcs) ; | |
424 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
425 | as sertThat(v iolations. size()).is EqualTo(1) ; | |
426 | ||
427 | } | |
428 | ||
429 | /* * | |
430 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Empt y Services | |
431 | * / | |
432 | @T est | |
433 | public void vali dationFail edDueToEmp tyServices () | |
434 | { | |
435 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", 5 , null, nu ll, null, | |
436 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.da tehold, Se ocObjectGe nerator.qa sp1, new A rrayList<P ayableServ ice>()); | |
437 | ||
438 | Set< Hptc> hptc s = new Ha shSet<Hptc >(); | |
439 | hptc s.add(Seoc ObjectGene rator.hptc 1); | |
440 | test Seoc.setHp tcs(hptcs) ; | |
441 | ||
442 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
443 | as sertThat(v iolations. size()).is EqualTo(1) ; | |
444 | ||
445 | } | |
446 | ||
447 | /* * | |
448 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Miss ing Servic e attribut es | |
449 | * / | |
450 | @T est | |
451 | public void vali dationFail edMissingS erviceFiel ds() | |
452 | { | |
453 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", 5 , null, nu ll, null, | |
454 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.in progress, SeocObject Generator. qasp1, new ArrayList <PayableSe rvice>()); | |
455 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, null, n ull, null, 0, null, null, null , SeocObje ctGenerato r.cs1, tes tSeoc); | |
456 | test Seoc.getSe rvices().a dd(service 1); | |
457 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
458 | ||
459 | Se t<Hptc> hp tcs = new HashSet<Hp tc>(); | |
460 | hptc s.add(Seoc ObjectGene rator.hptc 1); | |
461 | test Seoc.setHp tcs(hptcs) ; | |
462 | ||
463 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
464 | as sertThat(v iolations. size()).is EqualTo(3) ; | |
465 | ||
466 | } | |
467 | ||
468 | /* * | |
469 | * Descripti on: Seoc A ctivate Su ccess | |
470 | * / | |
471 | @T est | |
472 | public void vali dationSucc eeds() | |
473 | { | |
474 | Inte ger maxVis its = null ; | |
475 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", m axVisits, null, null , null, | |
476 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.in progress, SeocObject Generator. qasp1, new ArrayList <PayableSe rvice>()); | |
477 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, "desc", null, nul l, 5, Code Required.N O.getValue (), null, null, Seoc ObjectGene rator.cs1, testSeoc) ; | |
478 | test Seoc.getSe rvices().a dd(service 1); | |
479 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
480 | ||
481 | Se t<Hptc> hp tcs = new HashSet<Hp tc>(); | |
482 | hptc s.add(Seoc ObjectGene rator.hptc 1); | |
483 | test Seoc.setHp tcs(hptcs) ; | |
484 | ||
485 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
486 | as sertThat(v iolations. size()).is EqualTo(0) ; | |
487 | ||
488 | } | |
489 | /* * | |
490 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Null Hptc | |
491 | * / | |
492 | @T est | |
493 | public void vali dationFail ed_nullHpt c() | |
494 | { | |
495 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", 5 , null, nu ll, null, | |
496 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.da tehold, Se ocObjectGe nerator.qa sp1, new A rrayList<P ayableServ ice>()); | |
497 | ||
498 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, "desc", null, nul l, 5, Code Required.N O.getValue (), null, null, Seoc ObjectGene rator.cs1, testSeoc) ; | |
499 | test Seoc.getSe rvices().a dd(service 1); | |
500 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
501 | ||
502 | te stSeoc.set Hptcs(null ); | |
503 | ||
504 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
505 | as sertThat(v iolations. size()).is EqualTo(1) ; | |
506 | ||
507 | } | |
508 | ||
509 | /* * | |
510 | * Descripti on: Seoc A ctivate Co ndition Ch eck - Empt y Hptc | |
511 | * / | |
512 | @T est | |
513 | public void vali dationFail ed_emptyHp tc() | |
514 | { | |
515 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "name", 1, null, nul l, null, " disclaimer ", 5, "des cription", true, "pr oceduralOv erview", 5 , null, nu ll, null, | |
516 | null, Se ocObjectGe nerator.cc 1, SeocObj ectGenerat or.sl1, Se ocObjectGe nerator.da tehold, Se ocObjectGe nerator.qa sp1, new A rrayList<P ayableServ ice>()); | |
517 | ||
518 | Paya bleService service1 = SeocObje ctGenerato r.getPayab leService( 1, "desc", null, nul l, 5, Code Required.N O.getValue (), null, null, Seoc ObjectGene rator.cs1, testSeoc) ; | |
519 | test Seoc.getSe rvices().a dd(service 1); | |
520 | te stSeoc.set Status(Seo cObjectGen erator.dat ehold); | |
521 | ||
522 | te stSeoc.set Hptcs(new HashSet<Hp tc>()); | |
523 | ||
524 | Se t<Constrai ntViolatio n<Seoc>> v iolations = validato r.validate (testSeoc) ; | |
525 | as sertThat(v iolations. size()).is EqualTo(1) ; | |
526 | ||
527 | } | |
528 | ||
529 | /* * | |
530 | * Descripti on: Effect ive Date i s Null | |
531 | * / | |
532 | @T est | |
533 | pu blic void calculateS tatus_retu rnDraft() | |
534 | { | |
535 | Stri ng expecte dStatus = Constants. STATUS_INP ROGRESS; | |
536 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, nul l, null, n ull, 0, nu ll, | |
537 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
538 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1,null) ; | |
539 | ||
540 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
541 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
542 | } | |
543 | ||
544 | /* * | |
545 | * Descripti on: Effect ive Date n ext day En d Date nul l- return DRAFT | |
546 | * / | |
547 | @T est | |
548 | pu blic void calculateS tatus_retu rnEffectiv aDateTomor row() | |
549 | { | |
550 | Stri ng expecte dStatus = Constants. STATUS_INP ROGRESS; | |
551 | //Se t effectiv e date to tomorrow a fter 5:01 am | |
552 | Cale ndar cal = Calendar. getInstanc e(); | |
553 | cal. setTime(ne w Date()); | |
554 | cal. add(Calend ar.DATE, 1 ); | |
555 | cal. set(Calend ar.HOUR, 5 ); | |
556 | cal. set(Calend ar.MINUTE, 1); | |
557 | cal. set(Calend ar.SECOND, 0); | |
558 | cal. set(Calend ar.AM_PM, Calendar.A M); | |
559 | Date effective Date = cal .getTime() ; | |
560 | ||
561 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, eff ectiveDate , null, nu ll, 0, nul l, | |
562 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
563 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1,null) ; | |
564 | ||
565 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
566 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
567 | } | |
568 | ||
569 | /* * | |
570 | * Descripti on: Effect ive date i s earlier than today and end d ate is nul l | |
571 | * / | |
572 | @T est | |
573 | pu blic void calculateS tatus_retu rnEffectiv aDateBefor eToday() | |
574 | { | |
575 | Stri ng expecte dStatus = Constants. STATUS_ACT IVE; | |
576 | Date effective Date = Api Util.conve rtStringTo Date("09-0 4-2018 03: 34:05 AM") ; | |
577 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, eff ectiveDate , null, nu ll, 0, nul l, | |
578 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
579 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1,null) ; | |
580 | ||
581 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
582 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
583 | } | |
584 | ||
585 | /* * | |
586 | * Descripti on: Effect ive Date i s earlier than today and end d ate after today | |
587 | * / | |
588 | @T est | |
589 | pu blic void calculateS tatus_retu rnEffectiv aDateEndDa te() | |
590 | { | |
591 | Date effective Date = Api Util.conve rtStringTo Date("09-0 4-2018 07: 34:05 AM") ; | |
592 | Date endDate = new Date( ); | |
593 | Stri ng expecte dStatus = Constants. STATUS_ACT IVE; | |
594 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, eff ectiveDate , endDate, null, 0, null, | |
595 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
596 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1,null) ; | |
597 | ||
598 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
599 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
600 | } | |
601 | ||
602 | /* * | |
603 | * Descripti on: Effect ive Date a nd End Dat e past tod ay | |
604 | * / | |
605 | @T est | |
606 | pu blic void calculateS tatus_retu rnEffectiv aDateEndDa tePassed() | |
607 | { | |
608 | Date effective Date = Api Util.conve rtStringTo Date("09-0 4-2018 07: 34:05 AM") ; | |
609 | Date endDate = ApiUtil.c onvertStri ngToDate(" 09-05-2018 07:34:05 AM"); | |
610 | Stri ng expecte dStatus = Constants. STATUS_DIS CONTINUED; | |
611 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, eff ectiveDate , endDate, null, 0, null, | |
612 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
613 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.inp rogress, S eocObjectG enerator.q asp1,null) ; | |
614 | ||
615 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
616 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
617 | } | |
618 | ||
619 | ||
620 | /* * | |
621 | * Descripti on: SEOC w ith legacy status Dr aft return s In-Progr ess | |
622 | * / | |
623 | @T est | |
624 | pu blic void calculateS tatus_lega cyStatusDr aft() | |
625 | { | |
626 | Stri ng expecte dStatus = Constants. STATUS_INP ROGRESS; | |
627 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, nul l, null, n ull, 0, nu ll, | |
628 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
629 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.dra ft, SeocOb jectGenera tor.qasp1, null); | |
630 | ||
631 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
632 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
633 | } | |
634 | ||
635 | /* * | |
636 | * Descripti on: SEOC w ith legacy status Ac tive retur ns Date Ho ld | |
637 | * / | |
638 | @T est | |
639 | pu blic void calculateS tatus_lega cyStatusAc tive() | |
640 | { | |
641 | Stri ng expecte dStatus = Constants. STATUS_DAT EHOLD; | |
642 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, nul l, null, n ull, 0, nu ll, | |
643 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
644 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.act ive, SeocO bjectGener ator.qasp1 ,null); | |
645 | ||
646 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
647 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
648 | } | |
649 | ||
650 | /* * | |
651 | * Descripti on: SEOC w ith legacy status Di scontinued returns D ate Hold | |
652 | * / | |
653 | @T est | |
654 | pu blic void calculateS tatus_lega cyStatusDi scontinued () | |
655 | { | |
656 | Stri ng expecte dStatus = Constants. STATUS_DAT EHOLD; | |
657 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, nul l, null, n ull, 0, nu ll, | |
658 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
659 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.dis continue, SeocObject Generator. qasp1,null ); | |
660 | ||
661 | Stri ng actualS tatus = te stSeoc.get Calculated Status(); | |
662 | asse rtThat(act ualStatus) .isEqualTo (expectedS tatus); | |
663 | } | |
664 | ||
665 | @T est | |
666 | pu blic void removeBill ingCode_su ccess() | |
667 | { | |
668 | Seoc testSeoc = SeocObje ctGenerato r.getSeoc( "Name", 1, null, nul l, null, n ull, 0, nu ll, | |
669 | false, n ull, 0, nu ll, "Syste m", null, "System", SeocObject Generator. cc1, | |
670 | SeocObje ctGenerato r.sl1, Seo cObjectGen erator.act ive, SeocO bjectGener ator.qasp1 ,null); | |
671 | Paya bleService serv = Se ocObjectGe nerator.ge tPayableSe rvice(1, " descriptio n", 4, "TE ST", 4, Co deRequired .YES.getVa lue(), "Sy stem", new Date(), S eocObjectG enerator.c s1, testSe oc); | |
672 | Bill ingCode bc 1 = SeocOb jectGenera tor.getBil lingCode(5 , "BC1", " CPT", "DES C", true); | |
673 | serv .setBillin gCodes(new HashSet<B illingCode >()); | |
674 | serv .getBillin gCodes().a dd(bc1); | |
675 | test Seoc.setSe rvices(new ArrayList <PayableSe rvice>()); | |
676 | test Seoc.getSe rvices().a dd(serv); | |
677 | asse rtThat(tes tSeoc.getS ervices(). get(0).get BillingCod es()).cont ains(bc1); | |
678 | test Seoc.remov eBillingCo de(bc1); | |
679 | asse rtThat(tes tSeoc.getS ervices(). get(0).get BillingCod es()).does NotContain (bc1); | |
680 | } | |
681 | ||
682 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.