Produced by Araxis Merge on 2/4/2019 11:34:05 AM Eastern 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 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\test\java\gov\va\mobile\vamf\mhpro\resource | AssessmentControllerSeverityTest.java | Tue Nov 14 19:31:17 2017 UTC |
| 2 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\test\java\gov\va\mobile\vamf\mhpro\resource | AssessmentControllerSeverityTest.java | Fri Feb 1 19:27:42 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 2100 |
| Changed | 1 | 2 |
| 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.mobil e.vamf.mhp ro.resourc e; | |
| 2 | ||
| 3 | import sta tic org.ha mcrest.Mat cherAssert .assertTha t; | |
| 4 | import sta tic org.ha mcrest.Mat chers.cont ainsString ; | |
| 5 | import sta tic org.ha mcrest.Mat chers.isIn ; | |
| 6 | import sta tic org.ju nit.Assert .assertNot Null; | |
| 7 | import sta tic org.ju nit.Assert .assertTru e; | |
| 8 | import sta tic org.mo ckito.Matc hers.any; | |
| 9 | import sta tic org.mo ckito.Mock ito.when; | |
| 10 | import sta tic org.sp ringframew ork.test.w eb.servlet .request.M ockMvcRequ estBuilder s.get; | |
| 11 | import sta tic org.sp ringframew ork.test.w eb.servlet .request.M ockMvcRequ estBuilder s.post; | |
| 12 | import sta tic org.sp ringframew ork.test.w eb.servlet .request.M ockMvcRequ estBuilder s.put; | |
| 13 | import sta tic org.sp ringframew ork.test.w eb.servlet .result.Mo ckMvcResul tMatchers. status; | |
| 14 | ||
| 15 | import jav a.util.Arr ayList; | |
| 16 | import jav a.util.Arr ays; | |
| 17 | import jav a.util.Col lection; | |
| 18 | import jav a.util.Lis t; | |
| 19 | ||
| 20 | import org .joda.time .DateTime; | |
| 21 | import org .joda.time .DateTimeC omparator; | |
| 22 | import org .junit.Aft er; | |
| 23 | import org .junit.Bef ore; | |
| 24 | import org .junit.Tes t; | |
| 25 | import org .junit.run ner.RunWit h; | |
| 26 | import org .mockito.M ock; | |
| 27 | import org .mockito.M ockito; | |
| 28 | import org .mockito.M ockitoAnno tations; | |
| 29 | import org .mockito.i nvocation. Invocation OnMock; | |
| 30 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 31 | import org .springfra mework.htt p.MediaTyp e; | |
| 32 | import org .springfra mework.sec urity.core .Authentic ation; | |
| 33 | import org .springfra mework.sec urity.core .GrantedAu thority; | |
| 34 | import org .springfra mework.sec urity.core .context.S ecurityCon text; | |
| 35 | import org .springfra mework.sec urity.core .context.S ecurityCon textHolder ; | |
| 36 | import org .springfra mework.tes t.context. ContextCon figuration ; | |
| 37 | import org .springfra mework.tes t.context. junit4.Spr ingJUnit4C lassRunner ; | |
| 38 | import org .springfra mework.tes t.context. web.WebApp Configurat ion; | |
| 39 | import org .springfra mework.tes t.util.Ref lectionTes tUtils; | |
| 40 | import org .springfra mework.tes t.web.serv let.MvcRes ult; | |
| 41 | ||
| 42 | import com .agilex.he althcare.m obilehealt hplatform. domain.Mhp User; | |
| 43 | import com .agilex.he althcare.m obilehealt hplatform. domain.Pat ientIdenti fier; | |
| 44 | import com .agilex.he althcare.m obilehealt hplatform. security.R oles; | |
| 45 | import com .google.gs on.Gson; | |
| 46 | import com .google.gs on.GsonBui lder; | |
| 47 | ||
| 48 | import gov .va.mobile .vamf.comm on.ecrud.u til.DateUt ils; | |
| 49 | import gov .va.mobile .vamf.mhpr o.common.F requency; | |
| 50 | import gov .va.mobile .vamf.mhpr o.datalaye r.Assessme ntReposito ry; | |
| 51 | import gov .va.mobile .vamf.mhpr o.datalaye r.Assessme ntVoiceInf oRepositor y; | |
| 52 | import gov .va.mobile .vamf.mhpr o.datalaye r.Assignme ntReposito ry; | |
| 53 | import gov .va.mobile .vamf.mhpr o.datalaye r.EventRep ository; | |
| 54 | import gov .va.mobile .vamf.mhpr o.datalaye r.QuartzSe maphoreRep ository; | |
| 55 | import gov .va.mobile .vamf.mhpr o.domain.A nswer; | |
| 56 | import gov .va.mobile .vamf.mhpr o.domain.A ssessment; | |
| 57 | import gov .va.mobile .vamf.mhpr o.domain.A ssessmentV oiceInfo; | |
| 58 | import gov .va.mobile .vamf.mhpr o.domain.A ssignment; | |
| 59 | import gov .va.mobile .vamf.mhpr o.domain.A ssignmentS et; | |
| 60 | import gov .va.mobile .vamf.mhpr o.domain.E vent; | |
| 61 | import gov .va.mobile .vamf.mhpr o.domain.F ormat; | |
| 62 | import gov .va.mobile .vamf.mhpr o.domain.R esponse; | |
| 63 | import gov .va.mobile .vamf.mhpr o.domain.R esponseSec tion; | |
| 64 | import gov .va.mobile .vamf.mhpr o.domain.S core; | |
| 65 | import gov .va.mobile .vamf.mhpr o.domain.S coreMetaDa ta; | |
| 66 | import gov .va.mobile .vamf.mhpr o.jobs.Eve ntsJob; | |
| 67 | import gov .va.mobile .vamf.mhpr o.service. IAssessmen tVoiceInfo Service; | |
| 68 | import gov .va.mobile .vamf.mhpr o.service. ICurrentUs erService; | |
| 69 | import gov .va.mobile .vamf.mhpr o.service. impl.Asses smentServi ce; | |
| 70 | import gov .va.mobile .vamf.mhpr o.service. impl.Event Service; | |
| 71 | import gov .va.mobile .vamf.mhpr o.service. impl.MVICo nversionSe rvice; | |
| 72 | import gov .va.mobile .vamf.mhpr o.service. impl.Vista Assessment Service; | |
| 73 | ||
| 74 | /** | |
| 75 | * The Cla ss Assessm entControl lerTest. | |
| 76 | */ | |
| 77 | @RunWith(S pringJUnit 4ClassRunn er.class) | |
| 78 | @WebAppCon figuration | |
| 79 | @ContextCo nfiguratio n({ "class path:appli cationCont ext.xml", "classpath :dispatche r-servlet. xml", | |
| 80 | "cla sspath:mon goContext. xml" }) | |
| 81 | /** | |
| 82 | * | |
| 83 | * @author PII | |
| 84 | * | |
| 85 | */ | |
| 86 | public cla ss Assessm entControl lerSeverit yTest exte nds Abstra ctMVCContr ollerTeste r { | |
| 87 | ||
| 88 | pr ivate stat ic List<St ring> asse ssmentIds = new Arra yList<Stri ng>(); | |
| 89 | ||
| 90 | pr ivate stat ic List<St ring> assi gnmentIds = new Arra yList<Stri ng>(); | |
| 91 | ||
| 92 | pr ivate stat ic String patientId = "6660000 01"; | |
| 93 | ||
| 94 | pr ivate stat ic String assessment Id; | |
| 95 | ||
| 96 | pr ivate stat ic List<St ring> assi gnmentIdsF orDates = Arrays.asL ist("12345 67890", "2 234567890" , "3234567 890", | |
| 97 | "42345 67890", "5 234567890" , "6234567 890", "723 4567890", "823456789 0"); | |
| 98 | pr ivate stat ic List<St ring> assi gnmentIdsF orDatesFin alize = Ar rays.asLis t("9912345 67890", "9 9223456789 0", | |
| 99 | "99323 4567890", "994234567 890", "995 234567890" , "9962345 67890", "9 9723456789 0", "99823 4567890"); | |
| 100 | ||
| 101 | /* * The gson . */ | |
| 102 | pr ivate stat ic Gson gs on; | |
| 103 | ||
| 104 | @M ock | |
| 105 | pr ivate Vist aAssessmen tService v istaAssess mentServic e; | |
| 106 | @M ock | |
| 107 | pr ivate ICur rentUserSe rvice user Service; | |
| 108 | @M ock | |
| 109 | pr ivate MVIC onversionS ervice mvi Conversion Service; | |
| 110 | @M ock | |
| 111 | pr ivate Even tService e ventServic e; | |
| 112 | @M ock | |
| 113 | pr ivate Quar tzSemaphor eRepositor y quartzSe maphoreRep ository; | |
| 114 | ||
| 115 | @A utowired | |
| 116 | pr ivate Asse ssmentVoic eInfoRepos itory repo ; | |
| 117 | @A utowired | |
| 118 | pr ivate Even tsJob even tsJob; | |
| 119 | @A utowired | |
| 120 | pr ivate Asse ssmentServ ice assess mentServic e; | |
| 121 | @A utowired | |
| 122 | pr ivate Asse ssmentRepo sitory ass essmentRep ository; | |
| 123 | @A utowired | |
| 124 | pr ivate Asse ssmentReso urce contr oller; | |
| 125 | @A utowired | |
| 126 | pr ivate Assi gnmentReso urce assig nmentContr oller; | |
| 127 | @A utowired | |
| 128 | pr ivate Assi gnmentRepo sitory ass ignmentRep ository; | |
| 129 | @A utowired | |
| 130 | pr ivate Even tRepositor y eventRep ository; | |
| 131 | @A utowired | |
| 132 | pr ivate Asse ssmentVoic eInfoResou rce assess mentVoiceI nfoService ; | |
| 133 | ||
| 134 | pr ivate MhpU ser user; | |
| 135 | pr ivate int counter = 1; | |
| 136 | ||
| 137 | pr ivate List <Assessmen tVoiceInfo > results; | |
| 138 | pr ivate Asse ssment pro viderAsses sment; | |
| 139 | ||
| 140 | pr ivate Stri ng provide rEventId; | |
| 141 | ||
| 142 | pr ivate fina l static S tring EVEN T_PROVIDER _SECURITY = Assessme ntVoiceInf o.Assessme ntSeverity .HIGH.getN ame(); | |
| 143 | ||
| 144 | pr ivate clas s CreateAs sessmentAn swer imple ments org. mockito.st ubbing.Ans wer<Assess ment> { | |
| 145 | @Ove rride | |
| 146 | publ ic Assessm ent answer (Invocatio nOnMock in vocation) throws Thr owable { | |
| 147 | Assess ment resul t = (Asses sment) inv ocation.ge tArguments ()[0]; | |
| 148 | if (re sult.get_i d() == nul l) { | |
| 149 | result.s et_id(Stri ng.valueOf (++counter )); | |
| 150 | } | |
| 151 | update Assessment WithRespon se(result) ; | |
| 152 | return result; | |
| 153 | } | |
| 154 | } | |
| 155 | ||
| 156 | /* * | |
| 157 | * Test get provider e vents. | |
| 158 | * | |
| 159 | * @throws E xception | |
| 160 | * the exc eption | |
| 161 | * / | |
| 162 | @T est | |
| 163 | pu blic void testGetPro viderEvent s() throws Exception { | |
| 164 | // V erify even t | |
| 165 | Even t event = new Event( ); | |
| 166 | even t.setPatie ntAssignAu th("EDIPI" ); | |
| 167 | even t.setProvi derAssignA uth("dfn-0 00"); | |
| 168 | even t.setProvi derId("345 346"); | |
| 169 | even t.set_asse ssmentId(" fake"); | |
| 170 | even t.setEvent Type(Event .DUE); | |
| 171 | even t.setPatie ntId(patie ntId); | |
| 172 | even t.setPatie ntVirtualD eleted(fal se); | |
| 173 | even t.setProvi derVirtual Deleted(fa lse); | |
| 174 | even tRepositor y.save(eve nt); | |
| 175 | prov iderEventI d = event. get_id(); | |
| 176 | ||
| 177 | Refl ectionTest Utils.setF ield(contr oller, "us erService" , userServ ice); | |
| 178 | ||
| 179 | user = new Mhp User(); | |
| 180 | Pati entIdentif ier identi fier = new PatientId entifier() ; | |
| 181 | iden tifier.set AssigningA uthority(" dfn-000"); | |
| 182 | iden tifier.set UniqueId(" 345346"); | |
| 183 | Refl ectionTest Utils.setF ield(user, "userIden tifier", i dentifier) ; | |
| 184 | ||
| 185 | when (userServi ce.getUser ()).thenRe turn(user) ; | |
| 186 | ||
| 187 | Even t eventRep o = eventR epository. findBy_id( providerEv entId); | |
| 188 | even tRepo.setE ventType(E vent.COMPL ETED); | |
| 189 | even tRepositor y.save(eve ntRepo); | |
| 190 | ||
| 191 | MvcR esult resu lt = mockM vc | |
| 192 | .perform (get(Event Resource.R EQUEST_PRO VIDER_MAPP ING_WITH_P ROVIDER).c ontentType (MediaType .APPLICATI ON_JSON)) | |
| 193 | .andExpe ct(status( ).isOk()). andReturn( ); | |
| 194 | ||
| 195 | Stri ng respons eBody = re sult.getRe sponse().g etContentA sString(); | |
| 196 | // a ssertThat( responseBo dy, | |
| 197 | // c ontainsStr ing("\"pro viderId\": \"345346\" ")); | |
| 198 | asse rtThat(res ponseBody, containsS tring( | |
| 199 | TestUtil s.buildCon tainsStrin gAndWrapSt ringsWithE scapedDoub leQuote("p roviderId" , patientI d))); | |
| 200 | ||
| 201 | } | |
| 202 | ||
| 203 | /* - | |
| 204 | * Run tests for each assessment type and range, val idating th e severity | |
| 205 | * | |
| 206 | // BAM-R provider | |
| 207 | // BAM-R patient | |
| 208 | GAD-7 pr ovider | |
| 209 | GAD-7 pa tient | |
| 210 | PCL-5 pr ovider | |
| 211 | PCL-5 pa tient | |
| 212 | PHQ-9 pr ovider | |
| 213 | PHQ-9 pa tient | |
| 214 | * | |
| 215 | * @throws E xception | |
| 216 | * the exc eption | |
| 217 | * / | |
| 218 | @T est | |
| 219 | pu blic void testAssess mentVoiceI nfoDbConte nt() throw s Exceptio n { | |
| 220 | ||
| 221 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "GAD -7", 0, 0, | |
| 222 | Assessme ntVoiceInf o.Assessme ntSeverity .NO_SYMPTO MS); | |
| 223 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "GAD -7", 1, 9, | |
| 224 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 225 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "GAD -7", 10, 1 4, | |
| 226 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 227 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "GAD -7", 15, 2 1, | |
| 228 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 229 | ||
| 230 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PCL -5", 0, 0, | |
| 231 | Assessme ntVoiceInf o.Assessme ntSeverity .NO_SYMPTO MS); | |
| 232 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PCL -5", 1, 20 , | |
| 233 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 234 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PCL -5", 21, 4 0, | |
| 235 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 236 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PCL -5", 41, 8 0, | |
| 237 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 238 | ||
| 239 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 0, 0, | |
| 240 | Assessme ntVoiceInf o.Assessme ntSeverity .NO_SYMPTO MS); | |
| 241 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 1, 9, | |
| 242 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 243 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 10, 1 4, | |
| 244 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 245 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 15, 1 9, | |
| 246 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATEL Y_HIGH); | |
| 247 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 20, 2 7, | |
| 248 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 249 | ||
| 250 | // p rovider | |
| 251 | // v alidateAss essmentVoi ceInfoDbCo ntent(IAss essmentVoi ceInfoServ ice.SCOPE_ PROVIDER, | |
| 252 | // " BAM-R", 0, 10, | |
| 253 | // A ssessmentV oiceInfo.A ssessmentS everity.MI LD); | |
| 254 | // v alidateAss essmentVoi ceInfoDbCo ntent(IAss essmentVoi ceInfoServ ice.SCOPE_ PROVIDER, | |
| 255 | // " BAM-R", 11 , 20, | |
| 256 | // A ssessmentV oiceInfo.A ssessmentS everity.MI LD); | |
| 257 | // v alidateAss essmentVoi ceInfoDbCo ntent(IAss essmentVoi ceInfoServ ice.SCOPE_ PROVIDER, | |
| 258 | // " BAM-R", 21 , 40, | |
| 259 | // A ssessmentV oiceInfo.A ssessmentS everity.MO DERATE); | |
| 260 | // v alidateAss essmentVoi ceInfoDbCo ntent(IAss essmentVoi ceInfoServ ice.SCOPE_ PROVIDER, | |
| 261 | // " BAM-R", 41 , 60, | |
| 262 | // A ssessmentV oiceInfo.A ssessmentS everity.MO DERATE); | |
| 263 | // v alidateAss essmentVoi ceInfoDbCo ntent(IAss essmentVoi ceInfoServ ice.SCOPE_ PROVIDER, | |
| 264 | // " BAM-R", 61 , 80, | |
| 265 | // A ssessmentV oiceInfo.A ssessmentS everity.HI GH); | |
| 266 | ||
| 267 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "GA D-7", 0, 9 , | |
| 268 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 269 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "GA D-7", 10, 14, | |
| 270 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 271 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "GA D-7", 15, 21, | |
| 272 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 273 | ||
| 274 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PC L-5", 0, 1 0, | |
| 275 | Assessme ntVoiceInf o.Assessme ntSeverity .NONE); | |
| 276 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PC L-5", 11, 20, | |
| 277 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 278 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PC L-5", 21, 40, | |
| 279 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 280 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PC L-5", 41, 60, | |
| 281 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 282 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PC L-5", 61, 80, | |
| 283 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 284 | ||
| 285 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 0, 4 , | |
| 286 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 287 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 5, 1 4, | |
| 288 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 289 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 15, 27, | |
| 290 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 291 | } | |
| 292 | ||
| 293 | /* | |
| 294 | * PHQ-9 pa tient | |
| 295 | * No Sympt oms 0-0 | |
| 296 | * Mild 1- 9 | |
| 297 | * Moderate 10-14 | |
| 298 | * Moderate ly-High 15-19 | |
| 299 | * High 20 -27 | |
| 300 | * / | |
| 301 | @T est | |
| 302 | pu blic void testAssess mentVoiceI nfoDbConte ntFor_Pati entPHQ_9() throws Ex ception { | |
| 303 | ||
| 304 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 0, 0, | |
| 305 | Assessme ntVoiceInf o.Assessme ntSeverity .NO_SYMPTO MS); | |
| 306 | ||
| 307 | ||
| 308 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 1, 1, | |
| 309 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 310 | ||
| 311 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 5, 5, | |
| 312 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 313 | ||
| 314 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 9, 9, | |
| 315 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 316 | ||
| 317 | ||
| 318 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 10, 1 0, | |
| 319 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 320 | ||
| 321 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 12, 1 2, | |
| 322 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 323 | ||
| 324 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 14, 1 4, | |
| 325 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 326 | ||
| 327 | ||
| 328 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 15, 1 5, | |
| 329 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATEL Y_HIGH); | |
| 330 | ||
| 331 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 17, 1 7, | |
| 332 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATEL Y_HIGH); | |
| 333 | ||
| 334 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 19, 1 9, | |
| 335 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATEL Y_HIGH); | |
| 336 | ||
| 337 | ||
| 338 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 20, 2 0, | |
| 339 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 340 | ||
| 341 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 25, 2 5, | |
| 342 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 343 | ||
| 344 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PAT IENT, "PHQ -9", 27, 2 7, | |
| 345 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH); | |
| 346 | } | |
| 347 | ||
| 348 | /* | |
| 349 | * PHQ-9 pr ovider | |
| 350 | * Mild 0-4 | |
| 351 | * Moderate 5-14 | |
| 352 | * Severe 15-27 | |
| 353 | * / | |
| 354 | @T est | |
| 355 | pu blic void testAssess mentVoiceI nfoDbConte ntFor_Prov iderPHQ_9( ) throws E xception { | |
| 356 | ||
| 357 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 0, 0 , | |
| 358 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 359 | ||
| 360 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 2, 2 , | |
| 361 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 362 | ||
| 363 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 4, 4 , | |
| 364 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD); | |
| 365 | ||
| 366 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 5, 5 , | |
| 367 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 368 | ||
| 369 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 9, 9 , | |
| 370 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 371 | ||
| 372 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 14, 14, | |
| 373 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE) ; | |
| 374 | ||
| 375 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 15, 15, | |
| 376 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 377 | ||
| 378 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 16, 16, | |
| 379 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 380 | ||
| 381 | vali dateAssess mentVoiceI nfoDbConte nt(IAssess mentVoiceI nfoService .SCOPE_PRO VIDER, "PH Q-9", 27, 27, | |
| 382 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE); | |
| 383 | } | |
| 384 | ||
| 385 | ||
| 386 | /* | |
| 387 | * AUDC pro vider | |
| 388 | * Female | |
| 389 | * Nega tive 0-2 | |
| 390 | * Posi tive 3-12 | |
| 391 | * Male | |
| 392 | * Nega tive 0-3 | |
| 393 | * Posi tive 4-12 | |
| 394 | * / | |
| 395 | @T est | |
| 396 | pu blic void testAssess mentVoiceI nfoDbConte ntFor_Prov iderAUDC() throws Ex ception { | |
| 397 | ||
| 398 | // f emale | |
| 399 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PROVIDER, "AUDC", 0 , 2, | |
| 400 | Assessme ntVoiceInf o.Assessme ntSeverity .NEGATIVE, "Female") ; | |
| 401 | ||
| 402 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PROVIDER, "AUDC", 3 , 12, | |
| 403 | Assessme ntVoiceInf o.Assessme ntSeverity .POSITIVE, "Female") ; | |
| 404 | ||
| 405 | // M ale | |
| 406 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PROVIDER, "AUDC", 0 , 3, | |
| 407 | Assessme ntVoiceInf o.Assessme ntSeverity .NEGATIVE, "Male"); | |
| 408 | ||
| 409 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PROVIDER, "AUDC", 4 , 12, | |
| 410 | Assessme ntVoiceInf o.Assessme ntSeverity .POSITIVE, "Male"); | |
| 411 | } | |
| 412 | ||
| 413 | ||
| 414 | /* | |
| 415 | * AUDC pat ient | |
| 416 | * Female | |
| 417 | * Nega tive 0-2 | |
| 418 | * Posi tive 3-12 | |
| 419 | * Male | |
| 420 | * Nega tive 0-3 | |
| 421 | * Posi tive 4-12 | |
| 422 | * / | |
| 423 | @T est | |
| 424 | pu blic void testAssess mentVoiceI nfoDbConte ntFor_Pati entAUDC() throws Exc eption { | |
| 425 | ||
| 426 | // f emale | |
| 427 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PATIENT, "AUDC", 0, 2, | |
| 428 | Assessme ntVoiceInf o.Assessme ntSeverity .NEGATIVE, "Female") ; | |
| 429 | ||
| 430 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PATIENT, "AUDC", 3, 12, | |
| 431 | Assessme ntVoiceInf o.Assessme ntSeverity .POSITIVE, "Female") ; | |
| 432 | ||
| 433 | // M ale | |
| 434 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PATIENT, "AUDC", 0, 3, | |
| 435 | Assessme ntVoiceInf o.Assessme ntSeverity .NEGATIVE, "Male"); | |
| 436 | ||
| 437 | vali dateAUDCAs sessmentVo iceInfoDbC ontent(IAs sessmentVo iceInfoSer vice.SCOPE _PATIENT, "AUDC", 4, 12, | |
| 438 | Assessme ntVoiceInf o.Assessme ntSeverity .POSITIVE, "Male"); | |
| 439 | } | |
| 440 | ||
| 441 | ||
| 442 | /* * | |
| 443 | * Validate Assessment VoiceInfo Mongo Db C ontent mat ches expec ted range and | |
| 444 | * severity value | |
| 445 | * | |
| 446 | * @param sc ope | |
| 447 | * @param as sessmentTy pe | |
| 448 | * @param lo wScore | |
| 449 | * @param hi ghScore | |
| 450 | * @param as sessmentSe verity | |
| 451 | * / | |
| 452 | pr ivate void validateA ssessmentV oiceInfoDb Content(St ring scope , String a ssessmentT ype, int l owScore, i nt highSco re, | |
| 453 | Assess mentVoiceI nfo.Assess mentSeveri ty assessm entSeverit y) { | |
| 454 | List <Assessmen tVoiceInfo > result; | |
| 455 | ||
| 456 | resu lt = repo | |
| 457 | .findByS copeIgnore CaseAndAss essmentNam eIgnoreCas eAndLowSco reLessThan EqualAndHi ghScoreGre aterThanEq ual( | |
| 458 | sc ope, asses smentType, lowScore, highScore ); | |
| 459 | ||
| 460 | asse rtNotNull( result); | |
| 461 | ||
| 462 | for (Assessmen tVoiceInfo assessmen tVoiceInfo : result) { | |
| 463 | assert NotNull(as sessmentVo iceInfo); | |
| 464 | ||
| 465 | Syste m.out.prin tln("asses smentVoice Info scope :"+scope + ", assessm entVoiceIn fo assessm entType:"+ assessment Type | |
| 466 | +", a ssessmentV oiceInfo.g etSeverity ():"+asses smentVoice Info.getSe verity() | |
| 467 | +", A ssessmentV oiceInfo.A ssessmentS everity.ge tByName(as sessmentVo iceInfo.ge tSeverity( )):" | |
| 468 | + Ass essmentVoi ceInfo.Ass essmentSev erity.getB yName(asse ssmentVoic eInfo.getS everity()) ); | |
| 469 | ||
| 470 | assert NotNull(as sessmentVo iceInfo.ge tSeverity( )); | |
| 471 | assert NotNull(As sessmentVo iceInfo.As sessmentSe verity.get ByName(ass essmentVoi ceInfo.get Severity() )); | |
| 472 | ||
| 473 | // val idate seve rity value is in: | |
| 474 | assert That(asses smentVoice Info.getSe verity(), isIn(Array s.asList(a ssessmentS everity.ge tName()))) ; | |
| 475 | } | |
| 476 | } | |
| 477 | ||
| 478 | /* * | |
| 479 | * Validate Assessment VoiceInfo Mongo Db C ontent mat ches expec ted range and | |
| 480 | * severity value | |
| 481 | * | |
| 482 | * @param sc ope | |
| 483 | * @param as sessmentTy pe | |
| 484 | * @param lo wScore | |
| 485 | * @param hi ghScore | |
| 486 | * @param as sessmentSe verity | |
| 487 | * @param ge nder | |
| 488 | * / | |
| 489 | pr ivate void validateA UDCAssessm entVoiceIn foDbConten t(String s cope, Stri ng assessm entType, i nt lowScor e, int hig hScore, | |
| 490 | Assess mentVoiceI nfo.Assess mentSeveri ty assessm entSeverit y, String gender) { | |
| 491 | List <Assessmen tVoiceInfo > result; | |
| 492 | ||
| 493 | resu lt = repo | |
| 494 | .findByS copeIgnore CaseAndAss essmentNam eIgnoreCas eAndLowSco reLessThan EqualAndHi ghScoreGre aterThanEq ualAndGend erIgnoreCa se( | |
| 495 | sc ope, asses smentType, lowScore, highScore , gender); | |
| 496 | ||
| 497 | asse rtNotNull( result); | |
| 498 | ||
| 499 | for (Assessmen tVoiceInfo assessmen tVoiceInfo : result) { | |
| 500 | assert NotNull(as sessmentVo iceInfo); | |
| 501 | ||
| 502 | Syste m.out.prin tln("asses smentVoice Info scope :"+scope + ", assessm entVoiceIn fo assessm entType:"+ assessment Type | |
| 503 | +", asses smentVoice Info.getSe verity():" +assessmen tVoiceInfo .getSeveri ty() | |
| 504 | +", asses smentVoice Info.getGe nder():"+a ssessmentV oiceInfo.g etGender() | |
| 505 | +", A ssessmentV oiceInfo.A ssessmentS everity.ge tByName(as sessmentVo iceInfo.ge tSeverity( )):" | |
| 506 | + Ass essmentVoi ceInfo.Ass essmentSev erity.getB yName(asse ssmentVoic eInfo.getS everity()) ); | |
| 507 | ||
| 508 | assert NotNull(as sessmentVo iceInfo.ge tSeverity( )); | |
| 509 | assert NotNull(As sessmentVo iceInfo.As sessmentSe verity.get ByName(ass essmentVoi ceInfo.get Severity() )); | |
| 510 | ||
| 511 | // val idate seve rity value is in: | |
| 512 | assert That(asses smentVoice Info.getSe verity(), isIn(Array s.asList(a ssessmentS everity.ge tName()))) ; | |
| 513 | ||
| 514 | assert NotNull(as sessmentVo iceInfo.ge tGender()) ; | |
| 515 | ||
| 516 | } | |
| 517 | } | |
| 518 | ||
| 519 | /* * | |
| 520 | * execute A ssessment find | |
| 521 | * / | |
| 522 | pr ivate void runFindBy ScopeIgnor eCaseAndAs sessmentTy peIgnoreCa seAndLowSc oreLessTha nEqualAndH ighScoreGr eaterThanE qual() { | |
| 523 | List <Assessmen tVoiceInfo > testResu lts = new ArrayList< Assessment VoiceInfo> (); | |
| 524 | List <Assessmen tVoiceInfo > tempResu lts; | |
| 525 | int maxScore = 1000; | |
| 526 | ||
| 527 | for (String sc ope : new String[] { IAssessme ntVoiceInf oService.S COPE_PATIE NT, | |
| 528 | IAssessm entVoiceIn foService. SCOPE_PROV IDER }) { | |
| 529 | for (S tring asse ssmentType : new Str ing[] { "P CL-5", "BA M-R", "PHQ -9" }) { | |
| 530 | for (int score = 0 ; score <= maxScore; score += 1) { | |
| 531 | //for (i nt score = 0; score <= maxScor e; score + = 5) { | |
| 532 | tempResult s = repo | |
| 533 | .fin dByScopeIg noreCaseAn dAssessmen tNameIgnor eCaseAndLo wScoreLess ThanEqualA ndHighScor eGreaterTh anEqual( | |
| 534 | scope, a ssessmentT ype, score , score); | |
| 535 | testResult s.addAll(t empResults ); | |
| 536 | } | |
| 537 | } | |
| 538 | } | |
| 539 | ||
| 540 | asse rtNotNull( testResult s); | |
| 541 | ||
| 542 | Stri ng[] asses smentSever ity = new String[] { | |
| 543 | Assessme ntVoiceInf o.Assessme ntSeverity .NONE.getN ame(), | |
| 544 | Assessme ntVoiceInf o.Assessme ntSeverity .NEGATIVE. getName(), | |
| 545 | Assessme ntVoiceInf o.Assessme ntSeverity .POSITIVE. getName(), | |
| 546 | Assessme ntVoiceInf o.Assessme ntSeverity .NO_SYMPTO MS.getName (), | |
| 547 | Assessme ntVoiceInf o.Assessme ntSeverity .MILD.getN ame(), | |
| 548 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATE. getName(), | |
| 549 | Assessme ntVoiceInf o.Assessme ntSeverity .MODERATEL Y_HIGH.get Name(), | |
| 550 | Assessme ntVoiceInf o.Assessme ntSeverity .HIGH.getN ame(), | |
| 551 | Assessme ntVoiceInf o.Assessme ntSeverity .SEVERE.ge tName() }; | |
| 552 | ||
| 553 | for (Assessmen tVoiceInfo assessmen tVoiceInfo : testRes ults) { | |
| 554 | assert NotNull(as sessmentVo iceInfo); | |
| 555 | ||
| 556 | // Sys tem.out.pr intln("ass essmentVoi ceInfo.get Severity() :"+assessm entVoiceIn fo.getSeve rity()); | |
| 557 | // Sys tem.out.pr intln("Ass essmentVoi ceInfo.Ass essmentSev erity.getB yName(asse ssmentVoic eInfo.getS everity()) :"+ | |
| 558 | // Ass essmentVoi ceInfo.Ass essmentSev erity.getB yName(asse ssmentVoic eInfo.getS everity()) ); | |
| 559 | ||
| 560 | assert NotNull(as sessmentVo iceInfo.ge tSeverity( )); | |
| 561 | assert NotNull(As sessmentVo iceInfo.As sessmentSe verity.get ByName(ass essmentVoi ceInfo.get Severity() )); | |
| 562 | ||
| 563 | // val idate valu e is one o f: | |
| 564 | assert That(asses smentVoice Info.getSe verity(), isIn(Array s.asList(a ssessmentS everity))) ; | |
| 565 | } | |
| 566 | } | |
| 567 | ||
| 568 | /* * | |
| 569 | * Sets up t est cases. | |
| 570 | * | |
| 571 | * @throws E xception | |
| 572 | * the exc eption | |
| 573 | * / | |
| 574 | @B efore | |
| 575 | pu blic void setUp() th rows Excep tion { | |
| 576 | Mock itoAnnotat ions.initM ocks(this) ; | |
| 577 | ||
| 578 | Refl ectionTest Utils.setF ield(contr oller, "us erService" , userServ ice); | |
| 579 | Refl ectionTest Utils.setF ield(asses smentVoice InfoServic e, "userSe rvice", us erService) ; | |
| 580 | Refl ectionTest Utils.setF ield(asses smentServi ce, "vista Assessment Service", vistaAsses smentServi ce); | |
| 581 | ||
| 582 | Refl ectionTest Utils.setF ield(contr oller, "co nversionSe rvice", mv iConversio nService); | |
| 583 | Refl ectionTest Utils.setF ield(assig nmentContr oller, "us erService" , userServ ice); | |
| 584 | Refl ectionTest Utils.setF ield(assig nmentContr oller, "mv iConversio nService", mviConver sionServic e); | |
| 585 | ||
| 586 | user = new Mhp User(); | |
| 587 | Pati entIdentif ier identi fier = new PatientId entifier() ; | |
| 588 | iden tifier.set AssigningA uthority(" EDIPI"); | |
| 589 | iden tifier.set UniqueId(p atientId); | |
| 590 | Refl ectionTest Utils.setF ield(user, "userIden tifier", i dentifier) ; | |
| 591 | ||
| 592 | when (userServi ce.getUser ()).thenRe turn(user) ; | |
| 593 | when (mviConver sionServic e.convertP atientDfnT oEdipi(any (String.cl ass), any( String.cla ss))) | |
| 594 | .thenRet urn(identi fier); | |
| 595 | ||
| 596 | Gson Builder bu ilder = ne w GsonBuil der(); | |
| 597 | buil der.setDat eFormat(Da teUtils.DA TE_FORMAT_ NO_MS); | |
| 598 | gson = builder .create(); | |
| 599 | Asse ssment ass essment = new Assess ment(); | |
| 600 | asse ssment.set PatientId( patientId) ; | |
| 601 | asse ssment.set PatientAss ignAuth("E DIPI"); | |
| 602 | // a ssessment. setAssessm entName("G AD-7"); | |
| 603 | asse ssment.set Assessment Name("PCL- 5"); | |
| 604 | asse ssment.set ProviderId (patientId ); | |
| 605 | asse ssment.set Completed( Boolean.TR UE); | |
| 606 | Date Time today = new Dat eTime(); | |
| 607 | Date Time start Date = tod ay.minusDa ys(4); | |
| 608 | Date Time endDa te = today .plusDays( 5); | |
| 609 | asse ssment.set StartDate( startDate) ; | |
| 610 | asse ssment.set EndDate(en dDate); | |
| 611 | ||
| 612 | this .providerA ssessment = assessme nt; | |
| 613 | ||
| 614 | // c ompleted t est | |
| 615 | Assi gnment ass ignment = new Assign ment(); | |
| 616 | assi gnment.set PatientId( patientId) ; | |
| 617 | assi gnment.set PatientAss ignAuth(as sessment.g etPatientA ssignAuth( )); | |
| 618 | assi gnment.set Recurrence Early(new Integer(4) ); | |
| 619 | assi gnment.set Recurrence Late(new I nteger(5)) ; | |
| 620 | assi gnment.set Completed( Boolean.TR UE); | |
| 621 | assi gnmentRepo sitory.sav e(assignme nt); | |
| 622 | assi gnmentIds. add(assign ment.get_i d()); | |
| 623 | asse ssment.set _assignmen tId(assign ment.get_i d()); | |
| 624 | ||
| 625 | Resp onseSectio n response Section = new Respon seSection( ); | |
| 626 | List <Answer> a nswers = n ew ArrayLi st<Answer> (); | |
| 627 | resp onseSectio n.setAnswe rs(answers ); | |
| 628 | List <ResponseS ection> li stSections = new Arr ayList<Res ponseSecti on>(); | |
| 629 | list Sections.a dd(respons eSection); | |
| 630 | ||
| 631 | List <Score> sc ores = new ArrayList <>(); | |
| 632 | scor es.add(new Score("To tal", "13" )); | |
| 633 | ||
| 634 | Resp onse respo nse = new Response() ; | |
| 635 | resp onse.setSe ctions(lis tSections) ; | |
| 636 | resp onse.setDa teSubmitte d(DateTime .now()); | |
| 637 | resp onse.setSc ores(score s); | |
| 638 | asse ssment.set Response(r esponse); | |
| 639 | ||
| 640 | List <ScoreMeta Data> scor eMetaDataL ist = new ArrayList< ScoreMetaD ata>(); | |
| 641 | Form at format = new Form at(); | |
| 642 | asse ssment.set Format(for mat); | |
| 643 | asse ssment.get Format().s etScoreMet aDataList( scoreMetaD ataList); | |
| 644 | ||
| 645 | asse ssmentRepo sitory.sav e(assessme nt); | |
| 646 | asse ssmentId = assessmen t.get_id() ; | |
| 647 | asse ssmentIds. add(assess ment.get_i d()); | |
| 648 | ||
| 649 | Even t event = new Event( ); | |
| 650 | even t.setPatie ntVirtualD eleted(Boo lean.FALSE ); | |
| 651 | even t.setProvi derVirtual Deleted(Bo olean.FALS E); | |
| 652 | even t.setProvi derAssignA uth("EDIPI "); | |
| 653 | even t.set_asse ssmentId(a ssessmentI d); | |
| 654 | even t.setPatie ntAssignAu th(assessm ent.getPat ientAssign Auth()); | |
| 655 | even t.setPatie ntId(asses sment.getP atientId() ); | |
| 656 | even t.setProvi derId(pati entId); | |
| 657 | even t.setEvent Type(Event .COMPLETED ); | |
| 658 | even t.setAsses smentName( assessment .getAssess mentName() ); | |
| 659 | // s et severit y | |
| 660 | even t.setSever ity(EVENT_ PROVIDER_S ECURITY); | |
| 661 | ||
| 662 | // s et event " providedBy " info | |
| 663 | even t.setProvi dedByProvi derAssignA uth(assess ment.getPr oviderAssi gnAuth()); | |
| 664 | even t.setProvi dedByProvi derId(asse ssment.get ProviderId ()); | |
| 665 | ||
| 666 | even tRepositor y.save(eve nt); | |
| 667 | ||
| 668 | asse ssment.set _pastDueEv entId(even t.get_id() ); | |
| 669 | ||
| 670 | Even t eventPro vider = ne w Event(); | |
| 671 | even tProvider. setPatient VirtualDel eted(Boole an.FALSE); | |
| 672 | even tProvider. setProvide rVirtualDe leted(Bool ean.FALSE) ; | |
| 673 | even tProvider. set_assess mentId(ass essmentId) ; | |
| 674 | even tProvider. setProvide rAssignAut h("EDIPI") ; | |
| 675 | even tProvider. setProvide rId(patien tId); | |
| 676 | even tProvider. setPatient AssignAuth (assessmen t.getPatie ntAssignAu th()); | |
| 677 | even tProvider. setPatient Id(assessm ent.getPat ientId()); | |
| 678 | even tProvider. setEventTy pe(Event.C OMPLETED); | |
| 679 | even tProvider. setAssessm entName(as sessment.g etAssessme ntName()); | |
| 680 | ||
| 681 | // s et severit y | |
| 682 | even tProvider. setSeverit y(Assessme ntVoiceInf o.Assessme ntSeverity .HIGH.getN ame()); | |
| 683 | // e ventProvid er.setSeve rity(EVENT _PROVIDER_ SECURITY); | |
| 684 | ||
| 685 | // s et event " providedBy " info | |
| 686 | even tProvider. setProvide dByProvide rAssignAut h(assessme nt.getProv iderAssign Auth()); | |
| 687 | even tProvider. setProvide dByProvide rId(assess ment.getPr oviderId() ); | |
| 688 | ||
| 689 | even tRepositor y.save(eve ntProvider ); | |
| 690 | asse ssment.set _pastDueEv entId(even t.get_id() ); | |
| 691 | asse ssment.set ProviderAs signAuth(" EDIPI"); | |
| 692 | asse ssment.set ProviderId (patientId ); | |
| 693 | ||
| 694 | prov iderEventI d = event. get_id(); | |
| 695 | ||
| 696 | asse ssmentRepo sitory.sav e(assessme nt); | |
| 697 | ||
| 698 | runF indByScope IgnoreCase AndAssessm entTypeIgn oreCaseAnd LowScoreLe ssThanEqua lAndHighSc oreGreater ThanEqual( ); | |
| 699 | ||
| 700 | when (mviConver sionServic e.convertP atientDfnT oEdipi(any (String.cl ass), any( String.cla ss))) | |
| 701 | .thenRet urn(identi fier); | |
| 702 | } | |
| 703 | ||
| 704 | /* * | |
| 705 | * Tear down . | |
| 706 | * | |
| 707 | * @throws E xception | |
| 708 | * the exc eption | |
| 709 | * / | |
| 710 | @A fter | |
| 711 | pu blic void tearDown() throws Ex ception { | |
| 712 | for (String id : assessm entIds) { | |
| 713 | assess mentReposi tory.delet e(id); | |
| 714 | } | |
| 715 | clea nupAssignm entData(as signmentId sForDates) ; | |
| 716 | clea nupAssignm entData(as signmentId sForDatesF inalize); | |
| 717 | ||
| 718 | List <String> e ventTypes = new Arra yList<Stri ng>(); | |
| 719 | even tTypes.add (Event.FEE DBACK); | |
| 720 | even tTypes.add (Event.PAS T_DUE); | |
| 721 | even tTypes.add (Event.COM PLETED); | |
| 722 | even tTypes.add (Event.DUE ); | |
| 723 | even tTypes.add (Event.ASS IGNED); | |
| 724 | even tTypes.add (Event.COM PLETED); | |
| 725 | ||
| 726 | for (String id : assignm entIds) { | |
| 727 | assign mentReposi tory.delet e(id); | |
| 728 | List<E vent> even tsToDelete = eventRe pository | |
| 729 | .findByPat ientIdAndP atientAssi gnAuthAndP atientVirt ualDeleted AndEventTy peIn(patie ntId, "EDI PI", | |
| 730 | fals e, eventTy pes); | |
| 731 | if (ev entsToDele te != null ) { | |
| 732 | for (Eve nt event : eventsToD elete) { | |
| 733 | eventRepos itory.dele te(event); | |
| 734 | } | |
| 735 | } | |
| 736 | events ToDelete = eventRepo sitory.fin dByPatient IdAndPatie ntAssignAu thAndPatie ntVirtualD eletedAndE ventTypeIn ( | |
| 737 | patientId, "EDIPI", true, even tTypes); | |
| 738 | if (ev entsToDele te != null ) { | |
| 739 | for (Eve nt event : eventsToD elete) { | |
| 740 | eventRepos itory.dele te(event); | |
| 741 | } | |
| 742 | } | |
| 743 | } | |
| 744 | } | |
| 745 | ||
| 746 | pr ivate void cleanupAs signmentDa ta(List<St ring> ids) { | |
| 747 | for (String as signmentId : ids) { | |
| 748 | Assign ment assig nment = as signmentRe pository.f indBy_id(a ssignmentI d); | |
| 749 | if (as signment ! = null) { | |
| 750 | List<Str ing> asses smentIds = assignmen t.get_asse ssmentIds( ); | |
| 751 | for (Str ing id : a ssessmentI ds) { | |
| 752 | Assessment assessmen t = assess mentReposi tory.findB y_id(id); | |
| 753 | if (assess ment != nu ll) { | |
| 754 | if (assessme nt.get_due EventId() != null) { | |
| 755 | even tRepositor y.delete(a ssessment. get_dueEve ntId()); | |
| 756 | } | |
| 757 | as sessmentRe pository.d elete(asse ssment); | |
| 758 | } | |
| 759 | ||
| 760 | } | |
| 761 | List<Eve nt> list = eventRepo sitory.fin dBy_assign mentId(ass ignment.ge t_id()); | |
| 762 | if (list != null & & list.siz e() > 0) { | |
| 763 | for (Event e : list) { | |
| 764 | ev entReposit ory.delete (e); | |
| 765 | } | |
| 766 | } | |
| 767 | ||
| 768 | assignme ntReposito ry.delete( assignment ); | |
| 769 | } | |
| 770 | } | |
| 771 | ||
| 772 | } | |
| 773 | ||
| 774 | /* * | |
| 775 | * Test get patient as sessment v oiced info . | |
| 776 | * | |
| 777 | * @throws E xception | |
| 778 | * the exc eption | |
| 779 | * / | |
| 780 | @T est | |
| 781 | pu blic void testPatien t_GetAsses smentVoice dInfo() th rows Excep tion { | |
| 782 | MvcR esult pati entResult = mockMvc | |
| 783 | .perform (get(Asses smentVoice InfoResour ce.REQUEST _PATIENT_A SSESSMENT_ VOICED_INF O, "EDIPI" , patientI d, | |
| 784 | as sessmentId )) | |
| 785 | .andExpe ct(status( ).is2xxSuc cessful()) .andReturn (); | |
| 786 | ||
| 787 | Stri ng patient ResponseBo dy = patie ntResult.g etResponse ().getCont entAsStrin g(); | |
| 788 | Syst em.out.pri ntln("pati ent\n" + p atientResp onseBody); | |
| 789 | ||
| 790 | asse rtThat(pat ientRespon seBody, co ntainsStri ng( | |
| 791 | TestUtil s.buildCon tainsStrin gColonSpac edAndWrapS tringsWith EscapedDou bleQuote(" scope", "p atient"))) ; | |
| 792 | asse rtThat(pat ientRespon seBody, | |
| 793 | contains String(Tes tUtils.bui ldContains StringColo nSpacedAnd WrapString sWithEscap edDoubleQu ote("sever ity", | |
| 794 | As sessmentVo iceInfo.As sessmentSe verity.MIL D.getName( )))); | |
| 795 | } | |
| 796 | ||
| 797 | /* * | |
| 798 | * Test get provider a ssessment voiced inf o. | |
| 799 | * | |
| 800 | * @throws E xception | |
| 801 | * the exc eption | |
| 802 | * / | |
| 803 | @T est | |
| 804 | pu blic void testProvid er_GetAsse ssmentVoic edInfo() t hrows Exce ption { | |
| 805 | MvcR esult prov iderResult = mockMvc | |
| 806 | .perform (get(Asses smentVoice InfoResour ce.REQUEST _PROVIDER_ ASSESSMENT _VOICED_IN FO, "EDIPI ", patient Id, | |
| 807 | as sessmentId )) | |
| 808 | .andExpe ct(status( ).is2xxSuc cessful()) .andReturn (); | |
| 809 | ||
| 810 | Stri ng provide rResponseB ody = prov iderResult .getRespon se().getCo ntentAsStr ing(); | |
| 811 | Syst em.out.pri ntln("prov ider\n" + providerRe sponseBody ); | |
| 812 | ||
| 813 | asse rtThat(pro viderRespo nseBody, c ontainsStr ing( | |
| 814 | TestUtil s.buildCon tainsStrin gColonSpac edAndWrapS tringsWith EscapedDou bleQuote(" scope", "p rovider")) ); | |
| 815 | asse rtThat(pro viderRespo nseBody, | |
| 816 | contains String(Tes tUtils.bui ldContains StringColo nSpacedAnd WrapString sWithEscap edDoubleQu ote("sever ity", | |
| 817 | As sessmentVo iceInfo.As sessmentSe verity.MIL D.getName( )))); | |
| 818 | } | |
| 819 | ||
| 820 | /* * | |
| 821 | * test comp leted prov ider asses sments | |
| 822 | * | |
| 823 | * @throws E xception | |
| 824 | * / | |
| 825 | /* | |
| 826 | @T est | |
| 827 | pu blic void testProvid er_GetAllC ompletedAs sessments( ) throws E xception { | |
| 828 | Stri ng assignm entId = te stPatientU pdatePatie ntAssessme nt(); | |
| 829 | Assi gnment ass ignment = assignment Repository .findBy_id (assignmen tId); | |
| 830 | asse rtNotNull( assignment ); | |
| 831 | ||
| 832 | Mock Authentica tion authe ntication = new Mock Authentica tion(); | |
| 833 | Secu rityContex t security Context = Mockito.mo ck(Securit yContext.c lass); | |
| 834 | Mock ito.when(s ecurityCon text.getAu thenticati on()).then Return(aut henticatio n); | |
| 835 | Secu rityContex tHolder.se tContext(s ecurityCon text); | |
| 836 | MvcR esult resu lt = mockM vc.perform ( | |
| 837 | get(Asse ssmentReso urce.REQUE ST_PROVIDE R_ALL_MAPP ING, "EDIP I").conten tType(Medi aType.APPL ICATION_JS ON)) | |
| 838 | .andExpe ct(status( ).isOk()). andReturn( ); | |
| 839 | ||
| 840 | Stri ng respons eBody = re sult.getRe sponse().g etContentA sString(); | |
| 841 | asse rtThat(res ponseBody, containsS tring("\"p atientId\" :\"6660000 01\"")); | |
| 842 | } | |
| 843 | */ | |
| 844 | pr ivate void updateAss essmentWit hResponse( Assessment assessmen t) { | |
| 845 | Resp onseSectio n section = new Resp onseSectio n(); | |
| 846 | Answ er answer = new Answ er(); | |
| 847 | answ er.setAnsw erText("An swer"); | |
| 848 | sect ion.addAns wer(answer ); | |
| 849 | Resp onse respo nse = new Response() ; | |
| 850 | resp onse.setDa teSubmitte d(DateTime .now()); | |
| 851 | resp onse.addSe ction(sect ion); | |
| 852 | Scor e score = new Score( ); | |
| 853 | scor e.setRawSc ore("15"); | |
| 854 | scor e.setScale Name("Tota l"); | |
| 855 | resp onse.addSc ore(score) ; | |
| 856 | asse ssment.set Response(r esponse); | |
| 857 | Form at format = new Form at(); | |
| 858 | asse ssment.set Format(for mat); | |
| 859 | Scor eMetaData scoreMetaD ata = new ScoreMetaD ata(); | |
| 860 | scor eMetaData. setDefault Score(true ); | |
| 861 | scor eMetaData. setHighRis kAlertValu e("15"); | |
| 862 | scor eMetaData. setScaleNa me("Total" ); | |
| 863 | form at.getScor eMetaDataL ist().add( scoreMetaD ata); | |
| 864 | } | |
| 865 | ||
| 866 | pr ivate Assi gnmentSet buildAssig nments(Dat eTime star tDate) { | |
| 867 | List <Assignmen t> assignm ents = new ArrayList <Assignmen t>(); | |
| 868 | Assi gnment ass ignment = buildAssig nment(star tDate, ass ignmentIds ForDates.g et(0), Fre quency.DAI LY.name); | |
| 869 | assi gnments.ad d(assignme nt); | |
| 870 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(1), Freq uency.ANNU ALLY.name) ; | |
| 871 | assi gnments.ad d(assignme nt); | |
| 872 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(2), Freq uency.BIWE EKLY.name) ; | |
| 873 | assi gnments.ad d(assignme nt); | |
| 874 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(3), Freq uency.MONT HLY.name); | |
| 875 | assi gnments.ad d(assignme nt); | |
| 876 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(4), Freq uency.ONCE .name); | |
| 877 | assi gnments.ad d(assignme nt); | |
| 878 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(5), Freq uency.QUAR TERLY.name ); | |
| 879 | assi gnments.ad d(assignme nt); | |
| 880 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(6), Freq uency.SEMI ANNUALLY.n ame); | |
| 881 | assi gnments.ad d(assignme nt); | |
| 882 | assi gnment = b uildAssign ment(start Date, assi gnmentIdsF orDates.ge t(7), Freq uency.WEEK LY.name); | |
| 883 | assi gnments.ad d(assignme nt); | |
| 884 | Assi gnmentSet assignment Set = new Assignment Set(); | |
| 885 | assi gnmentSet. setAssignm entSet(ass ignments); | |
| 886 | retu rn assignm entSet; | |
| 887 | } | |
| 888 | ||
| 889 | pr ivate Assi gnmentSet buildAssig nments() { | |
| 890 | List <Assignmen t> assignm ents = new ArrayList <Assignmen t>(); | |
| 891 | Assi gnment ass ignment = buildAssig nment(assi gnmentIdsF orDates.ge t(0), Freq uency.DAIL Y.name); | |
| 892 | assi gnment.set Instructio ns("test") ; | |
| 893 | assi gnments.ad d(assignme nt); | |
| 894 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (1), Frequ ency.ANNUA LLY.name); | |
| 895 | assi gnments.ad d(assignme nt); | |
| 896 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (2), Frequ ency.BIWEE KLY.name); | |
| 897 | assi gnments.ad d(assignme nt); | |
| 898 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (3), Frequ ency.MONTH LY.name); | |
| 899 | assi gnments.ad d(assignme nt); | |
| 900 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (4), Frequ ency.ONCE. name); | |
| 901 | assi gnments.ad d(assignme nt); | |
| 902 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (5), Frequ ency.QUART ERLY.name) ; | |
| 903 | assi gnments.ad d(assignme nt); | |
| 904 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (6), Frequ ency.SEMIA NNUALLY.na me); | |
| 905 | assi gnments.ad d(assignme nt); | |
| 906 | assi gnment = b uildAssign ment(assig nmentIdsFo rDates.get (7), Frequ ency.WEEKL Y.name); | |
| 907 | assi gnments.ad d(assignme nt); | |
| 908 | Assi gnmentSet assignment Set = new Assignment Set(); | |
| 909 | assi gnmentSet. setAssignm entSet(ass ignments); | |
| 910 | retu rn assignm entSet; | |
| 911 | } | |
| 912 | ||
| 913 | pr ivate Assi gnment bui ldAssignme nt(DateTim e date, St ring assig nmentId, S tring freq uency) { | |
| 914 | Assi gnment ass ignment = new Assign ment(); | |
| 915 | assi gnment.set _id(assign mentId); | |
| 916 | ||
| 917 | assi gnment.set _whitelist Id("1234") ; | |
| 918 | assi gnment.set Assessment Name("GAD- 7"); | |
| 919 | assi gnment.set ClinicId(" 1234"); | |
| 920 | assi gnment.set ClinicName ("Clinic") ; | |
| 921 | if ( Frequency. ONCE.name. equals(fre quency)) | |
| 922 | assign ment.setNu mberOccurr ences(1); | |
| 923 | else | |
| 924 | assign ment.setNu mberOccurr ences(5); | |
| 925 | assi gnment.set PatientAss ignAuth("E DI-PI"); | |
| 926 | assi gnment.set ProviderAs signAuth(" dfn-000"); | |
| 927 | assi gnment.set PatientId( patientId) ; | |
| 928 | assi gnment.set ProviderId ("66600001 0"); | |
| 929 | assi gnment.set Recurrence Frequency( frequency) ; | |
| 930 | assi gnment.set StartDate( date); | |
| 931 | retu rn assignm ent; | |
| 932 | } | |
| 933 | ||
| 934 | pr ivate Assi gnment bui ldAssignme nt(String assignment Id, String frequency ) { | |
| 935 | retu rn buildAs signment(D ateTime.no w(), assig nmentId, f requency); | |
| 936 | } | |
| 937 | ||
| 938 | /* * | |
| 939 | * Test upda te patient assessmen t. | |
| 940 | * | |
| 941 | * @throws E xception | |
| 942 | * the exc eption | |
| 943 | * / | |
| 944 | ||
| 945 | pr ivate Stri ng testPat ientUpdate PatientAss essment() throws Exc eption { | |
| 946 | when (vistaAsse ssmentServ ice.retrie veAssessme nt(any(Ass essment.cl ass))).the nAnswer(ne w CreateAs sessmentAn swer()); | |
| 947 | when (vistaAsse ssmentServ ice.saveAn dScoreAsse ssment(any (Assessmen t.class))) | |
| 948 | .thenAns wer(new Cr eateAssess mentAnswer ()); | |
| 949 | Assi gnmentSet assignment Set = buil dAssignmen ts(); | |
| 950 | Stri ng json = gson.toJso n(assignme ntSet, Ass ignmentSet .class); | |
| 951 | mock Mvc.perfor m( | |
| 952 | post(Ass ignmentRes ource.REQU EST_PROVID ER_MAPPING _WITH_PROV IDER).cont entType(Me diaType.AP PLICATION_ JSON).cont ent(json)) | |
| 953 | .andExpe ct(status( ).isOk()). andReturn( ); | |
| 954 | ||
| 955 | Assi gnment ass ignment = assignment Repository .findBy_id (assignmen tIdsForDat es.get(0)) ; | |
| 956 | Stri ng modifie dAssignmen tId = assi gnment.get _id(); | |
| 957 | ||
| 958 | Stri ng id = as signment.g et_assessm entIds().g et(0); | |
| 959 | Asse ssment ass essment = assessment Repository .findBy_id (id); | |
| 960 | upda teAssessme ntWithResp onse(asses sment); | |
| 961 | json = gson.to Json(asses sment, Ass essment.cl ass); | |
| 962 | ||
| 963 | mock Mvc.perfor m(put(Asse ssmentReso urce.REQUE ST_PATIENT _ASSESSMEN T_ID_MAPPI NG, "EDIPI ", patient Id, id) | |
| 964 | .content Type(Media Type.APPLI CATION_JSO N_VALUE).c ontent(jso n)).andExp ect(status ().isOk()) .andReturn (); | |
| 965 | ||
| 966 | // G ET UPDATED ASSIGNMEN T | |
| 967 | for (String as signId : a ssignmentI dsForDates ) { | |
| 968 | assign ment = ass ignmentRep ository.fi ndBy_id(as signId); | |
| 969 | List<S tring> ass essmentIds = assignm ent.get_as sessmentId s(); | |
| 970 | if (Fr equency.ON CE.name.eq uals(assig nment.getR ecurrenceF requency() )) { | |
| 971 | assertTr ue(assessm entIds.siz e() == 1); | |
| 972 | assertTr ue(assignm ent.getTot alComplete d() == 0); | |
| 973 | assertTr ue(assignm ent.getNum berRemaini ng() == 1) ; | |
| 974 | } else { | |
| 975 | assertTr ue(assessm entIds.siz e() == 5); | |
| 976 | } | |
| 977 | ||
| 978 | if (Fr equency.DA ILY.name.e quals(assi gnment.get Recurrence Frequency( ))) { | |
| 979 | assertTr ue(assignm ent.getTot alComplete d() == 1); | |
| 980 | assertTr ue(assignm ent.getNum berRemaini ng() == 4) ; | |
| 981 | } else if (!Freq uency.ONCE .name.equa ls(assignm ent.getRec urrenceFre quency())) { | |
| 982 | assertTr ue(assignm ent.getTot alComplete d() == 0); | |
| 983 | assertTr ue(assignm ent.getNum berRemaini ng() == 5) ; | |
| 984 | } | |
| 985 | ||
| 986 | // Cal endar cal = new Greg orianCalen dar(); | |
| 987 | // cal .setTime(a ssignment. getStartDa te()); | |
| 988 | Freque ncy freque ncy = Freq uency.forN ame(assign ment.getRe currenceFr equency()) ; | |
| 989 | for (S tring asse ssmentId : assessmen tIds) { | |
| 990 | Assessme nt temp = assessment Repository .findBy_id (assessmen tId); | |
| 991 | assertTr ue(DateTim eComparato r.getDateO nlyInstanc e().compar e(temp.get DueDate(), | |
| 992 | as signment.g etStartDat e()) == 0) ; | |
| 993 | // cal.a dd(frequen cy.calenda rUnit, fre quency.cal endarIncre ment); | |
| 994 | } | |
| 995 | if (!F requency.D AILY.name. equals(ass ignment.ge tRecurrenc eFrequency ())) { | |
| 996 | assertTr ue(DateTim eComparato r.getDateO nlyInstanc e().compar e(assignme nt.getNext DueDate(), | |
| 997 | ne w DateTime ()) == 0); | |
| 998 | } | |
| 999 | } | |
| 1000 | retu rn modifie dAssignmen tId; | |
| 1001 | } | |
| 1002 | ||
| 1003 | cl ass MockAu thenticati on impleme nts Authen tication { | |
| 1004 | ||
| 1005 | priv ate static final lon g serialVe rsionUID = 533359337 1483334411 L; | |
| 1006 | ||
| 1007 | @Ove rride | |
| 1008 | publ ic String getName() { | |
| 1009 | // TOD O Auto-gen erated met hod stub | |
| 1010 | return null; | |
| 1011 | } | |
| 1012 | ||
| 1013 | @Ove rride | |
| 1014 | publ ic Collect ion<? exte nds Grante dAuthority > getAutho rities() { | |
| 1015 | Grante dAuthority grantedAu thority = Mockito.mo ck(Granted Authority. class); | |
| 1016 | List<G rantedAuth ority> lis t = new Ar rayList<>( ); | |
| 1017 | list.a dd(granted Authority) ; | |
| 1018 | Mockit o.when(gra ntedAuthor ity.getAut hority()). thenReturn (Roles.ROL E_STAFF); | |
| 1019 | return list; | |
| 1020 | } | |
| 1021 | ||
| 1022 | @Ove rride | |
| 1023 | publ ic Object getCredent ials() { | |
| 1024 | // TOD O Auto-gen erated met hod stub | |
| 1025 | return null; | |
| 1026 | } | |
| 1027 | ||
| 1028 | @Ove rride | |
| 1029 | publ ic Object getDetails () { | |
| 1030 | // TOD O Auto-gen erated met hod stub | |
| 1031 | return null; | |
| 1032 | } | |
| 1033 | ||
| 1034 | @Ove rride | |
| 1035 | publ ic Object getPrincip al() { | |
| 1036 | // TOD O Auto-gen erated met hod stub | |
| 1037 | return null; | |
| 1038 | } | |
| 1039 | ||
| 1040 | @Ove rride | |
| 1041 | publ ic boolean isAuthent icated() { | |
| 1042 | // TOD O Auto-gen erated met hod stub | |
| 1043 | return false; | |
| 1044 | } | |
| 1045 | ||
| 1046 | @Ove rride | |
| 1047 | publ ic void se tAuthentic ated(boole an isAuthe nticated) throws Ill egalArgume ntExceptio n { | |
| 1048 | // TOD O Auto-gen erated met hod stub | |
| 1049 | } | |
| 1050 | } | |
| 1051 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.