theanandankit

Untitled

Feb 6th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.59 KB | None | 0 0
  1. /**
  2.  * This Source Code Form is subject to the terms of the Mozilla Public License,
  3.  * v. 2.0. If a copy of the MPL was not distributed with this file, You can
  4.  * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
  5.  * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  6.  *
  7.  * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
  8.  * graphic logo is a trademark of OpenMRS Inc.
  9.  */
  10. package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8;
  11.  
  12. import org.openmrs.Patient;
  13. import org.openmrs.api.context.Context;
  14. import org.openmrs.module.webservices.rest.web.RestTestConstants1_8;
  15. import org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResourceTest;
  16.  
  17. public class PatientResource1_8Test extends BaseDelegatingResourceTest<PatientResource1_8, Patient> {
  18.  
  19.     @Override
  20.     public Patient newObject() {
  21.         return Context.getPatientService().getPatientByUuid(getUuidProperty());
  22.     }
  23.  
  24.     @Override
  25.     public void validateDefaultRepresentation() throws Exception {
  26.         super.validateDefaultRepresentation();;
  27.         assertPropPresent("display");
  28.         assertPropEquals("voided", getObject().getVoided());
  29.     }
  30.  
  31.     @Override
  32.     public void validateFullRepresentation() throws Exception {
  33.         super.validateFullRepresentation();
  34.         assertPropPresent("display");
  35.         assertPropEquals("voided", getObject().getVoided());
  36.     }
  37.  
  38.     @Override
  39.     public String getDisplayProperty() {
  40.         return "Mr. Horatio Test Hornblower Esq.";
  41.     }
  42.  
  43.     @Override
  44.     public String getUuidProperty() {
  45.         return RestTestConstants1_8.PATIENT_UUID;
  46.     }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment