@Test
  public void shouldAssignUnassignExistingPatientFromBed() throws Exception {
    int bedId = 9;
    PatientService patientService = Context.getPatientService();
    Patient patient = patientService.getPatient(3);

    EncounterService encounterService = Context.getEncounterService();
    List<Encounter> encountersByPatient = encounterService.getEncountersByPatient(patient);

    BedDetails bedDetails = bedManagementService.getBedAssignmentDetailsByPatient(patient);
    assertNotNull(bedDetails);
    Assert.assertEquals(11, bedDetails.getBedId());

    bedManagementService.assignPatientToBed(
        patient, encountersByPatient.get(0), String.valueOf(bedId));

    bedDetails = bedManagementService.getBedAssignmentDetailsByPatient(patient);
    assertEquals(bedId, bedDetails.getBedId());
  }
  @Test
  public void shouldReturnBedAssignmentDetailsByPatient() {
    PatientService patientService = Context.getPatientService();
    Patient patient = patientService.getPatient(3);

    LocationService locationService = Context.getLocationService();
    Location ward = locationService.getLocation(123452);
    String bedNumFromDataSetup = "307-a";

    BedDetails bedDetails = bedManagementService.getBedAssignmentDetailsByPatient(patient);
    assertEquals(ward.getId(), bedDetails.getPhysicalLocation().getId());
    assertEquals(bedIdFromDataSetup, bedDetails.getBedId());
    assertEquals(bedNumFromDataSetup, bedDetails.getBedNumber());
  }