=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/service/ActivityReportingServiceTest.java' --- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/service/ActivityReportingServiceTest.java 2013-10-22 04:01:39 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/service/ActivityReportingServiceTest.java 2013-11-06 18:33:17 +0000 @@ -34,6 +34,8 @@ import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient; import org.hisp.dhis.api.mobile.model.PatientAttribute; import org.hisp.dhis.api.mobile.model.PatientIdentifier; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -47,16 +49,22 @@ { @Autowired private ActivityReportingService activityReportingService; + + @Autowired + private OrganisationUnitService organisationUnitService; @Test public void testSavePatient() throws NotAllowedException { + OrganisationUnit orgUnit = createOrganisationUnit( 'O' ); + organisationUnitService.addOrganisationUnit( orgUnit ); + Patient patientA = this.createLWUITPatient( 'A' ); Patient patientB = this.createLWUITPatient( 'B' ); - int patientAId = activityReportingService.savePatient( patientA, 779, "" ); - int patientBId = activityReportingService.savePatient( patientB, 779, "" ); + int patientAId = activityReportingService.savePatient( patientA, orgUnit.getId(), "" ); + int patientBId = activityReportingService.savePatient( patientB, orgUnit.getId(), "" ); patientA = activityReportingService.findPatient( patientAId ); assertEquals( patientAId, patientA.getId() );