target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void downloadObservationsForPatients_shouldReturnSuccessAndCountWhenDownloadingObservationsForPatient() throws PatientController.PatientLoadException, ObservationController.DownloadObservationException, ConceptController.ConceptFetchException { String[] cohortUuids = new String[]{"uuid1"}; final Patient pa...
public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { p...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
@Test public void downloadObservationsForPatients_shouldReturnLoadErrorWhenLoadExceptionIsThrownForObservations() throws PatientController.PatientLoadException { String[] cohortUuids = new String[]{}; doThrow(new PatientController.PatientLoadException("")).when(patientController).getPatientsForCohorts(cohortUuids); int...
public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { p...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
@Test public void downloadObservationsForPatients_shouldReturnDownloadErrorWhenDownloadExceptionIsThrownForObservations() throws ObservationController.DownloadObservationException, PatientController.PatientLoadException, ConceptController.ConceptFetchException { String[] cohortUuids = new String[]{"uuid1"}; List<Patien...
public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { p...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
@Test public void shouldSortTheEncountersByDate() { final Observation observation1 = createObservation(createEncounter("c1", new Date(1)), "01"); final Observation observation2 = createObservation(createEncounter("c2", new Date(3)), "02"); final Encounters encounters = new Encounters(observation1, observation2); encoun...
public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.getEncounter().getEncounterDatetime()==null) return 1; retu...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
@Test public void downloadObservationsForPatients_shouldReturnReplaceErrorWhenReplaceExceptionIsThrownForObservations() throws ReplaceObservationException, PatientController.PatientLoadException, ConceptController.ConceptFetchException { String[] cohortUuids = new String[]{}; List<Patient> patients = new ArrayList<Pati...
public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { p...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
@Test public void downloadEncountersForPatients_shouldDownloadInBatch() throws PatientController.PatientLoadException, EncounterController.ReplaceEncounterException, EncounterController.DownloadEncounterException, SetupConfigurationController.SetupConfigurationFetchException { String[] cohortUuids = new String[]{"uuid1...
public int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { pati...
MuzimaSyncService { public int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patien...
MuzimaSyncService { public int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patien...
MuzimaSyncService { public int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patien...
MuzimaSyncService { public int[] downloadEncountersForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patien...
@Test public void shouldDeleteVoidedEncountersWhenDownloadingEncounters() throws EncounterController.DeleteEncounterException, EncounterController.DownloadEncounterException, SetupConfigurationController.SetupConfigurationFetchException { String[] patientUuids = new String[]{"patientUuid1", "patientUuid2"}; final Patie...
public int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; try { String activeSetupConfigUuid = null; try { SetupConfigurationTemplate setupConfigurationTemplate = setupConfigurationController.getActiveSetupConfigurationTemplate();...
MuzimaSyncService { public int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; try { String activeSetupConfigUuid = null; try { SetupConfigurationTemplate setupConfigurationTemplate = setupConfigurationController.getActiveSetupConf...
MuzimaSyncService { public int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; try { String activeSetupConfigUuid = null; try { SetupConfigurationTemplate setupConfigurationTemplate = setupConfigurationController.getActiveSetupConf...
MuzimaSyncService { public int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; try { String activeSetupConfigUuid = null; try { SetupConfigurationTemplate setupConfigurationTemplate = setupConfigurationController.getActiveSetupConf...
MuzimaSyncService { public int[] downloadEncountersForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingEncounters) { int[] result = new int[4]; try { String activeSetupConfigUuid = null; try { SetupConfigurationTemplate setupConfigurationTemplate = setupConfigurationController.getActiveSetupConf...
@Test public void consolidatePatients_shouldGetAllPatientsConsolidateSavePatientFromServerAndDeleteLocalPatient() throws PatientController.PatientSaveException { Patient localPatient = mock(Patient.class); Patient remotePatient = mock(Patient.class); when(patientController.consolidateTemporaryPatient(localPatient)).the...
public void consolidatePatients() { List<Patient> allLocalPatients = patientController.getAllPatientsCreatedLocallyAndNotSynced(); for (Patient localPatient : allLocalPatients) { Patient patientFromServer = patientController.consolidateTemporaryPatient(localPatient); if (patientFromServer != null) { checkChangeInPatien...
MuzimaSyncService { public void consolidatePatients() { List<Patient> allLocalPatients = patientController.getAllPatientsCreatedLocallyAndNotSynced(); for (Patient localPatient : allLocalPatients) { Patient patientFromServer = patientController.consolidateTemporaryPatient(localPatient); if (patientFromServer != null) {...
MuzimaSyncService { public void consolidatePatients() { List<Patient> allLocalPatients = patientController.getAllPatientsCreatedLocallyAndNotSynced(); for (Patient localPatient : allLocalPatients) { Patient patientFromServer = patientController.consolidateTemporaryPatient(localPatient); if (patientFromServer != null) {...
MuzimaSyncService { public void consolidatePatients() { List<Patient> allLocalPatients = patientController.getAllPatientsCreatedLocallyAndNotSynced(); for (Patient localPatient : allLocalPatients) { Patient patientFromServer = patientController.consolidateTemporaryPatient(localPatient); if (patientFromServer != null) {...
MuzimaSyncService { public void consolidatePatients() { List<Patient> allLocalPatients = patientController.getAllPatientsCreatedLocallyAndNotSynced(); for (Patient localPatient : allLocalPatients) { Patient patientFromServer = patientController.consolidateTemporaryPatient(localPatient); if (patientFromServer != null) {...
@Test public void shouldUpdatePatientsThatAreNotInCohorts() throws PatientController.PatientSaveException, PatientController.PatientDownloadException { Patient localPatient1 = patient("patientUUID1"); Patient localPatient2 = patient("patientUUID2"); Patient serverPatient1 = patient("patientUUID3"); when(patientControll...
public List<Patient> updatePatientsNotPartOfCohorts() { List<Patient> patientsNotInCohorts = patientController.getPatientsNotInCohorts(); List<Patient> downloadedPatients = new ArrayList<>(); try { for (Patient patient : patientsNotInCohorts) { downloadedPatients.add(patientController.downloadPatientByUUID(patient.getU...
MuzimaSyncService { public List<Patient> updatePatientsNotPartOfCohorts() { List<Patient> patientsNotInCohorts = patientController.getPatientsNotInCohorts(); List<Patient> downloadedPatients = new ArrayList<>(); try { for (Patient patient : patientsNotInCohorts) { downloadedPatients.add(patientController.downloadPatien...
MuzimaSyncService { public List<Patient> updatePatientsNotPartOfCohorts() { List<Patient> patientsNotInCohorts = patientController.getPatientsNotInCohorts(); List<Patient> downloadedPatients = new ArrayList<>(); try { for (Patient patient : patientsNotInCohorts) { downloadedPatients.add(patientController.downloadPatien...
MuzimaSyncService { public List<Patient> updatePatientsNotPartOfCohorts() { List<Patient> patientsNotInCohorts = patientController.getPatientsNotInCohorts(); List<Patient> downloadedPatients = new ArrayList<>(); try { for (Patient patient : patientsNotInCohorts) { downloadedPatients.add(patientController.downloadPatien...
MuzimaSyncService { public List<Patient> updatePatientsNotPartOfCohorts() { List<Patient> patientsNotInCohorts = patientController.getPatientsNotInCohorts(); List<Patient> downloadedPatients = new ArrayList<>(); try { for (Patient patient : patientsNotInCohorts) { downloadedPatients.add(patientController.downloadPatien...
@Test public void shouldDownloadAndSavePatientsGivenByUUID() throws PatientController.PatientDownloadException, PatientController.PatientSaveException { Patient patient1 = patient("patientUUID1"); Patient patient2 = patient("patientUUID2"); String[] patientUUIDs = new String[]{"patientUUID1", "patientUUID2"}; when(pati...
public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0] = SUCCESS; result[...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
@Test public void shouldReturnFailureIfDownloadFails() throws PatientController.PatientDownloadException, PatientController.PatientSaveException { Patient patient1 = patient("patientUUID1"); String[] patientUUIDs = new String[]{"patientUUID1"}; when(patientController.downloadPatientByUUID("patientUUID1")).thenReturn(pa...
public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0] = SUCCESS; result[...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
MuzimaSyncService { public int[] downloadPatients(String[] patientUUIDs) { int[] result = new int[2]; List<Patient> downloadedPatients; try { downloadedPatients = downloadPatientsByUUID(patientUUIDs); patientController.savePatients(downloadedPatients); Log.e(getClass().getSimpleName(), "DOWNLOADED PATIENTS."); result[0...
@Test public void shouldDeleteVoidedObservationsWhenDownloadingObservations() throws ObservationController.DeleteObservationException, ObservationController.DownloadObservationException, ReplaceObservationException, ConceptController.ConceptFetchException { List<String> patientUuids = Collections.singletonList("patient...
public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = split(patientUuids);...
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = ...
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = ...
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = ...
MuzimaSyncService { public int[] downloadObservationsForPatientsByPatientUUIDs(List<String> patientUuids, boolean replaceExistingObservations) { int[] result = new int[4]; try { List<String> conceptUuidsFromConcepts = getConceptUuidsFromConcepts(conceptController.getConcepts()); List<List<String>> slicedPatientUuids = ...
@Test public void shouldCreateEncounterEntityWithAppropriateValues() throws ProviderController.ProviderLoadException, FormController.FormFetchException { Date encounterDateTime = new Date(); final String formUuid = "formUuid"; String providerId = "providerId"; int locationId = 1; String userSystemId = "userSystemId"; f...
public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) { Encounter encounter = new Encounter(); encounter.setProvider(getDummyProvider(providerId)); encounter.setUuid(getEncounterUUID()); encounter.setLocat...
ObservationParserUtility { public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) { Encounter encounter = new Encounter(); encounter.setProvider(getDummyProvider(providerId)); encounter.setUuid(getEncounter...
ObservationParserUtility { public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) { Encounter encounter = new Encounter(); encounter.setProvider(getDummyProvider(providerId)); encounter.setUuid(getEncounter...
ObservationParserUtility { public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) { Encounter encounter = new Encounter(); encounter.setProvider(getDummyProvider(providerId)); encounter.setUuid(getEncounter...
ObservationParserUtility { public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) { Encounter encounter = new Encounter(); encounter.setProvider(getDummyProvider(providerId)); encounter.setUuid(getEncounter...
@Test public void shouldNotCreateNewConceptOrObservationForInvalidConceptName() { observationParserUtility = new ObservationParserUtility(muzimaApplication,true); assertThat(observationParserUtility.getNewConceptList().size(), is(0)); }
public List<Concept> getNewConceptList() { return newConceptList; }
ObservationParserUtility { public List<Concept> getNewConceptList() { return newConceptList; } }
ObservationParserUtility { public List<Concept> getNewConceptList() { return newConceptList; } ObservationParserUtility(MuzimaApplication muzimaApplication, boolean createObservationsForConceptsNotAvailableLocally); }
ObservationParserUtility { public List<Concept> getNewConceptList() { return newConceptList; } ObservationParserUtility(MuzimaApplication muzimaApplication, boolean createObservationsForConceptsNotAvailableLocally); Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, ...
ObservationParserUtility { public List<Concept> getNewConceptList() { return newConceptList; } ObservationParserUtility(MuzimaApplication muzimaApplication, boolean createObservationsForConceptsNotAvailableLocally); Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, ...
@Test public void shouldPutEncounterWithNullDateAtTheTopWhenItsNotAtTheTop() { final Observation observation1 = createObservation(createEncounter("c1", new Date(1)), "01"); final Observation observation2 = createObservation(createEncounter("c2", null), "02"); final Encounters encounters = new Encounters(observation1, o...
public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.getEncounter().getEncounterDatetime()==null) return 1; retu...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
@Test public void shouldCreateNumericObservation() throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ Concept concept = mock(Concept.class); when(concept.isNumeric()).thenReturn(true); when(concept.isCoded()).thenReturn(false); Obser...
public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Could not create Observation ...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
@Test public void shouldCreateObsWithStringForNonNumericNonCodedConcept() throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ observationParserUtility = new ObservationParserUtility(muzimaApplication,true); Concept concept = mock(Conc...
public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Could not create Observation ...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
ObservationParserUtility { public Observation getObservationEntity(Concept concept, String value) throws ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException{ if (concept == null) { throw new ObservationController.ParseObservationException("Co...
@Test public void shouldVerifyAllObservationsAndRelatedEntitiesAreSaved() throws EncounterController.SaveEncounterException, ConceptController.ConceptSaveException, ObservationController.SaveObservationException { htmlFormObservationCreator.createAndPersistObservations(readFile(),formDataUuid); verify(encounterControll...
public void createAndPersistObservations(String jsonResponse,String formDataUuid) { parseJSONResponse(jsonResponse,formDataUuid); try { saveObservationsAndRelatedEntities(); } catch (ConceptController.ConceptSaveException e) { Log.e(getClass().getSimpleName(), "Error while saving concept", e); } catch (EncounterControl...
HTMLFormObservationCreator { public void createAndPersistObservations(String jsonResponse,String formDataUuid) { parseJSONResponse(jsonResponse,formDataUuid); try { saveObservationsAndRelatedEntities(); } catch (ConceptController.ConceptSaveException e) { Log.e(getClass().getSimpleName(), "Error while saving concept", ...
HTMLFormObservationCreator { public void createAndPersistObservations(String jsonResponse,String formDataUuid) { parseJSONResponse(jsonResponse,formDataUuid); try { saveObservationsAndRelatedEntities(); } catch (ConceptController.ConceptSaveException e) { Log.e(getClass().getSimpleName(), "Error while saving concept", ...
HTMLFormObservationCreator { public void createAndPersistObservations(String jsonResponse,String formDataUuid) { parseJSONResponse(jsonResponse,formDataUuid); try { saveObservationsAndRelatedEntities(); } catch (ConceptController.ConceptSaveException e) { Log.e(getClass().getSimpleName(), "Error while saving concept", ...
HTMLFormObservationCreator { public void createAndPersistObservations(String jsonResponse,String formDataUuid) { parseJSONResponse(jsonResponse,formDataUuid); try { saveObservationsAndRelatedEntities(); } catch (ConceptController.ConceptSaveException e) { Log.e(getClass().getSimpleName(), "Error while saving concept", ...
@Test public void shouldReturnListOfConcepts() { String html = readFile(); List<String> concepts = new HTMLConceptParser().parse(html); assertThat(concepts.size(),is(7)); assertThat(concepts,hasItem("BODY PART")); assertThat(concepts,hasItem("PROCEDURES DONE THIS VISIT")); assertThat(concepts,hasItem("ANATOMIC LOCATION...
public List<String> parse(String html) { Set<String> concepts = new HashSet<>(); Document htmlDoc = Jsoup.parse(html); Elements elements = htmlDoc.select("*:not(div)[" + DATA_CONCEPT_TAG + "]"); for (Element element : elements) { concepts.add(getConceptName(element.attr(DATA_CONCEPT_TAG))); } return new ArrayList<>(con...
HTMLConceptParser { public List<String> parse(String html) { Set<String> concepts = new HashSet<>(); Document htmlDoc = Jsoup.parse(html); Elements elements = htmlDoc.select("*:not(div)[" + DATA_CONCEPT_TAG + "]"); for (Element element : elements) { concepts.add(getConceptName(element.attr(DATA_CONCEPT_TAG))); } return...
HTMLConceptParser { public List<String> parse(String html) { Set<String> concepts = new HashSet<>(); Document htmlDoc = Jsoup.parse(html); Elements elements = htmlDoc.select("*:not(div)[" + DATA_CONCEPT_TAG + "]"); for (Element element : elements) { concepts.add(getConceptName(element.attr(DATA_CONCEPT_TAG))); } return...
HTMLConceptParser { public List<String> parse(String html) { Set<String> concepts = new HashSet<>(); Document htmlDoc = Jsoup.parse(html); Elements elements = htmlDoc.select("*:not(div)[" + DATA_CONCEPT_TAG + "]"); for (Element element : elements) { concepts.add(getConceptName(element.attr(DATA_CONCEPT_TAG))); } return...
HTMLConceptParser { public List<String> parse(String html) { Set<String> concepts = new HashSet<>(); Document htmlDoc = Jsoup.parse(html); Elements elements = htmlDoc.select("*:not(div)[" + DATA_CONCEPT_TAG + "]"); for (Element element : elements) { concepts.add(getConceptName(element.attr(DATA_CONCEPT_TAG))); } return...
@Test public void shouldParseConcept() { List<String> conceptNames = utils.parse(getModel("concept.xml")); assertThat(conceptNames, hasItem("PULSE")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test public void shouldParseConceptInObs() { List<String> conceptNames = utils.parse(getModel("concept_in_obs.xml")); assertThat(conceptNames, hasItem("WEIGHT (KG)")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test public void shouldNotAddItToConceptUnLessBothDateAndTimeArePresentInChildren() { List<String> conceptNames = utils.parse(getModel("concepts_in_concept.xml")); assertThat(conceptNames.size(), is(2)); assertThat(conceptNames, hasItem("PROBLEM ADDED")); assertThat(conceptNames, hasItem("PROBLEM RESOLVED")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test public void shouldNotConsiderOptionsAsConcepts() { List<String> conceptNames = utils.parse(getModel("concepts_with_options.xml")); assertThat(conceptNames.size(), is(1)); assertThat(conceptNames, hasItem("MOST RECENT PAPANICOLAOU SMEAR RESULT")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test(expected = ConceptParser.ParseConceptException.class) public void shouldThrowParseConceptExceptionWhenTheModelHasNoEndTag() { utils.parse(getModel("concept_no_end_tag.xml")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test public void shouldParseConceptTM() { List<String> conceptNames = utils.parse(getModel("dispensary_concept_in_obs.xml")); assertThat(conceptNames, hasItem("START TIME")); assertThat(conceptNames, hasItem("END TIME")); }
public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } }
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
ConceptParser { public List<String> parse(String model) { try { if (StringUtils.isEmpty(model)) { return new ArrayList<>(); } parser.setInput(new ByteArrayInputStream(model.getBytes()), null); parser.nextTag(); return readConceptName(parser); } catch (Exception e) { throw new ParseConceptException(e); } } ConceptParser...
@Test public void shouldPutEncounterWithNullDateAtTheTopWhenItsAtTheTop() { final Observation observation1 = createObservation(createEncounter("c1", null), "01"); final Observation observation2 = createObservation(createEncounter("c2", new Date(1)), "02"); final Encounters encounters = new Encounters(observation1, obse...
public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.getEncounter().getEncounterDatetime()==null) return 1; retu...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
Encounters extends ArrayList<EncounterWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<EncounterWithObservations>() { @Override public int compare(EncounterWithObservations lhs, EncounterWithObservations rhs) { if (lhs.getEncounter().getEncounterDatetime()==null) return -1; if (rhs.g...
@Test public void shouldGetLastSyncTimeOfEncounter() throws Exception, EncounterController.DownloadEncounterException { List<String> patientUuids = asList("patientUuid1", "patientUuid2"); Date aDate = mock(Date.class); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS,"patientUuid1,patientUuid2")).thenRet...
public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS, pa...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
@Test public void shouldUseTheLastSyncTimeWhenDownloadingEncounters() throws Exception, EncounterController.DownloadEncounterException { Date lastSyncDate = mock(Date.class); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS,"patientUuid1,patientUuid2")).thenReturn(lastSyncDate); List<String> patientUuids...
public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS, pa...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
@Test public void shouldSaveTheUpdatedLastSyncTime() throws Exception, EncounterController.DownloadEncounterException { List<String> patientUuids = asList("patientUuid1", "patientUuid2"); Date updatedDate = mock(Date.class); when(sntpService.getTimePerDeviceTimeZone()).thenReturn(updatedDate); Date lastSyncDate = mock(...
public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS, pa...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
@Test public void shouldRecognisedAnInitiallyNonInitialisedLastSyncTime() throws EncounterController.DownloadEncounterException, IOException { List<String> newPatients = asList("patientUuid2"); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS,"patientUuid1,patientUuid2")).thenReturn(null); when(lastSyncT...
public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_ENCOUNTERS, pa...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
EncounterController { public List<Encounter> downloadEncountersByPatientUuids(List<String> patientUuids, String activeSetupConfigUuid) throws DownloadEncounterException { try { String paramSignature = StringUtils.getCommaSeparatedStringFromList(patientUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(D...
@Test public void getAllPatients_shouldReturnAllAvailablePatients() throws IOException, PatientController.PatientLoadException { List<Patient> patients = new ArrayList<>(); when(patientService.getAllPatients()).thenReturn(patients); assertThat(patientController.getAllPatients(), is(patients)); }
public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } }
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
@Test(expected = PatientController.PatientLoadException.class) public void getAllForms_shouldThrowFormFetchExceptionIfExceptionThrownByFormService() throws IOException, PatientController.PatientLoadException { doThrow(new IOException()).when(patientService).getAllPatients(); patientController.getAllPatients(); }
public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } }
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
PatientController { public List<Patient> getAllPatients() throws PatientLoadException { try { return patientService.getAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService p...
@Test public void getTotalPatientsCount_shouldReturnPatientsCount() throws IOException, PatientController.PatientLoadException { when(patientService.countAllPatients()).thenReturn(2); assertThat(patientController.countAllPatients(), is(2)); }
public int countAllPatients() throws PatientLoadException { try { return patientService.countAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } }
PatientController { public int countAllPatients() throws PatientLoadException { try { return patientService.countAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } }
PatientController { public int countAllPatients() throws PatientLoadException { try { return patientService.countAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService patient...
PatientController { public int countAllPatients() throws PatientLoadException { try { return patientService.countAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService patient...
PatientController { public int countAllPatients() throws PatientLoadException { try { return patientService.countAllPatients(); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,PatientTagService patient...
@Test public void replacePatients_shouldReplaceAllExistingPatientsAndAddNewPatients() throws IOException, PatientController.PatientSaveException { List<Patient> patients = buildPatients(); patientController.replacePatients(patients); verify(patientService).updatePatients(patients); verifyNoMoreInteractions(patientServi...
public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } }
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } }
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
@Test(expected = PatientController.PatientSaveException.class) public void replacePatients_shouldThrowPatientReplaceExceptionIfExceptionThrownByService() throws IOException, PatientController.PatientSaveException { List<Patient> patients = buildPatients(); doThrow(new IOException()).when(patientService).updatePatients(...
public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } }
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } }
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
PatientController { public void replacePatients(List<Patient> patients) throws PatientSaveException { try { patientService.updatePatients(patients); } catch (IOException e) { throw new PatientSaveException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Pati...
@Test public void getPatientsInCohort_shouldReturnThePatientsInTheCohort() throws IOException, PatientController.PatientLoadException { String cohortId = "cohortId"; List<CohortMember> members = buildCohortMembers(cohortId); when(cohortService.getCohortMembers(cohortId)).thenReturn(members); Patient patient = new Patie...
public List<Patient> getPatients(String cohortId) throws PatientLoadException { try { List<CohortMember> cohortMembers = cohortService.getCohortMembers(cohortId); return patientService.getPatientsFromCohortMembers(cohortMembers); } catch (IOException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> getPatients(String cohortId) throws PatientLoadException { try { List<CohortMember> cohortMembers = cohortService.getCohortMembers(cohortId); return patientService.getPatientsFromCohortMembers(cohortMembers); } catch (IOException e) { throw new PatientLoadException(e); } } }
PatientController { public List<Patient> getPatients(String cohortId) throws PatientLoadException { try { List<CohortMember> cohortMembers = cohortService.getCohortMembers(cohortId); return patientService.getPatientsFromCohortMembers(cohortMembers); } catch (IOException e) { throw new PatientLoadException(e); } } Patie...
PatientController { public List<Patient> getPatients(String cohortId) throws PatientLoadException { try { List<CohortMember> cohortMembers = cohortService.getCohortMembers(cohortId); return patientService.getPatientsFromCohortMembers(cohortMembers); } catch (IOException e) { throw new PatientLoadException(e); } } Patie...
PatientController { public List<Patient> getPatients(String cohortId) throws PatientLoadException { try { List<CohortMember> cohortMembers = cohortService.getCohortMembers(cohortId); return patientService.getPatientsFromCohortMembers(cohortMembers); } catch (IOException e) { throw new PatientLoadException(e); } } Patie...
@Test public void shouldGetObservationsByPatientUUID() throws ObservationController.LoadObservationException { ObservationController controller = mock(ObservationController.class); ConceptController conceptController = mock(ConceptController.class); ConceptsByPatient byPatient = new ConceptsByPatient(conceptController,...
@Override Concepts get() throws ObservationController.LoadObservationException { return controller.getConceptWithObservations(patientUuid); }
ConceptsByPatient extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.getConceptWithObservations(patientUuid); } }
ConceptsByPatient extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.getConceptWithObservations(patientUuid); } ConceptsByPatient(ConceptController conceptController, ObservationController controller, String patientUuid); }
ConceptsByPatient extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.getConceptWithObservations(patientUuid); } ConceptsByPatient(ConceptController conceptController, ObservationController controller, String patientUuid); @Override String toString(...
ConceptsByPatient extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.getConceptWithObservations(patientUuid); } ConceptsByPatient(ConceptController conceptController, ObservationController controller, String patientUuid); @Override String toString(...
@Test public void shouldSearchWithOutCohortUUIDIsNull() throws IOException, ParseException, PatientController.PatientLoadException { String searchString = "searchString"; List<Patient> patients = new ArrayList<>(); when(patientService.searchPatients(searchString)).thenReturn(patients); assertThat(patientController.sear...
public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
@Test public void shouldSearchWithOutCohortUUIDIsEmpty() throws IOException, ParseException, PatientController.PatientLoadException { String searchString = "searchString"; List<Patient> patients = new ArrayList<>(); when(patientService.searchPatients(searchString)).thenReturn(patients); assertThat(patientController.sea...
public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
@Test public void shouldCallSearchPatientWithCohortIDIfPresent() throws Exception, PatientController.PatientLoadException { String searchString = "searchString"; String cohortUUID = "cohortUUID"; List<Patient> patients = new ArrayList<>(); when(patientService.searchPatients(searchString, cohortUUID)).thenReturn(patient...
public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLoadException(e); } }
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
PatientController { public List<Patient> searchPatientLocally(String term, String cohortUuid) throws PatientLoadException { try { return StringUtils.isEmpty(cohortUuid) ? patientService.searchPatients(term) : patientService.searchPatients(term, cohortUuid); } catch (IOException | ParseException e) { throw new PatientLo...
@Test public void getPatientByUuid_shouldReturnPatientForId() throws Exception, PatientController.PatientLoadException { Patient patient = new Patient(); String uuid = "uuid"; when(patientService.getPatientByUuid(uuid)).thenReturn(patient); assertThat(patientController.getPatientByUuid(uuid), is(patient)); }
public Patient getPatientByUuid(String uuid) throws PatientLoadException { try { return patientService.getPatientByUuid(uuid); } catch (IOException e) { throw new PatientLoadException(e); } }
PatientController { public Patient getPatientByUuid(String uuid) throws PatientLoadException { try { return patientService.getPatientByUuid(uuid); } catch (IOException e) { throw new PatientLoadException(e); } } }
PatientController { public Patient getPatientByUuid(String uuid) throws PatientLoadException { try { return patientService.getPatientByUuid(uuid); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Patien...
PatientController { public Patient getPatientByUuid(String uuid) throws PatientLoadException { try { return patientService.getPatientByUuid(uuid); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Patien...
PatientController { public Patient getPatientByUuid(String uuid) throws PatientLoadException { try { return patientService.getPatientByUuid(uuid); } catch (IOException e) { throw new PatientLoadException(e); } } PatientController(PatientService patientService, CohortService cohortService, FormService formService,Patien...
@Test public void shouldSearchOnServerForPatientByNames() throws Exception { String name = "name"; List<Patient> patients = new ArrayList<>(); when(patientService.downloadPatientsByName(name)).thenReturn(patients); assertThat(patientController.searchPatientOnServer(name), is(patients)); verify(patientService).downloadP...
public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); }
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } }
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
@Test public void shouldReturnEmptyListIsExceptionThrown() throws Exception { String searchString = "name"; doThrow(new IOException()).when(patientService).downloadPatientsByName(searchString); assertThat(patientController.searchPatientOnServer(searchString).size(), is(0)); }
public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); }
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } }
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
PatientController { public List<Patient> searchPatientOnServer(String name) { try { return patientService.downloadPatientsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); } return new ArrayList<>(); } PatientController(PatientService patie...
@Test public void shouldConsolidatePatients() throws Exception { Patient tempPatient = mock(Patient.class); Patient patient = mock(Patient.class); when(patientService.consolidateTemporaryPatient(tempPatient)).thenReturn(patient); assertThat(patient, is(patientController.consolidateTemporaryPatient(tempPatient))); }
public Patient consolidateTemporaryPatient(Patient patient) { try { return patientService.consolidateTemporaryPatient(patient); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while consolidating the temporary patient.", e); } return null; }
PatientController { public Patient consolidateTemporaryPatient(Patient patient) { try { return patientService.consolidateTemporaryPatient(patient); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while consolidating the temporary patient.", e); } return null; } }
PatientController { public Patient consolidateTemporaryPatient(Patient patient) { try { return patientService.consolidateTemporaryPatient(patient); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while consolidating the temporary patient.", e); } return null; } PatientController(PatientService patien...
PatientController { public Patient consolidateTemporaryPatient(Patient patient) { try { return patientService.consolidateTemporaryPatient(patient); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while consolidating the temporary patient.", e); } return null; } PatientController(PatientService patien...
PatientController { public Patient consolidateTemporaryPatient(Patient patient) { try { return patientService.consolidateTemporaryPatient(patient); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while consolidating the temporary patient.", e); } return null; } PatientController(PatientService patien...
@Test public void getTotalFormCount_shouldReturnTotalAvailableForms() throws IOException, FormController.FormFetchException { when(formService.countAllForms()).thenReturn(2); assertThat(formController.getTotalFormCount(), is(2)); }
public int getTotalFormCount() throws FormFetchException { try { return formService.countAllForms(); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public int getTotalFormCount() throws FormFetchException { try { return formService.countAllForms(); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public int getTotalFormCount() throws FormFetchException { try { return formService.countAllForms(); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public int getTotalFormCount() throws FormFetchException { try { return formService.countAllForms(); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTempla...
FormController { public int getTotalFormCount() throws FormFetchException { try { return formService.countAllForms(); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTempla...
@Test public void getAllFormByTags_shouldFetchAllFormsWithGivenTags() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); when(formService.getAllForms()).thenReturn(forms); when(formService.isFormTemplateDownloaded(forms.get(0).getUuid())).thenReturn(false); when(formService.isFormT...
public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
@Test public void getAllFormByTags_shouldAssignDownloadStatusToForms() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); when(formService.getAllForms()).thenReturn(forms); when(formService.isFormTemplateDownloaded(forms.get(0).getUuid())).thenReturn(false); when(formService.isForm...
public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
@Test public void shouldSearchObservationsByUuidAndTerm() throws ObservationController.LoadObservationException { ObservationController controller = mock(ObservationController.class); ConceptController conceptController = mock(ConceptController.class); ConceptsBySearch conceptsBySearch = new ConceptsBySearch(conceptCon...
@Override Concepts get() throws ObservationController.LoadObservationException { return controller.searchObservationsGroupedByConcepts(term, patientUuid); }
ConceptsBySearch extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.searchObservationsGroupedByConcepts(term, patientUuid); } }
ConceptsBySearch extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.searchObservationsGroupedByConcepts(term, patientUuid); } ConceptsBySearch(ConceptController conceptController, ObservationController controller, String patientUuid, String term); ...
ConceptsBySearch extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.searchObservationsGroupedByConcepts(term, patientUuid); } ConceptsBySearch(ConceptController conceptController, ObservationController controller, String patientUuid, String term); ...
ConceptsBySearch extends ConceptAction { @Override Concepts get() throws ObservationController.LoadObservationException { return controller.searchObservationsGroupedByConcepts(term, patientUuid); } ConceptsBySearch(ConceptController conceptController, ObservationController controller, String patientUuid, String term); ...
@Test public void getAllFormByTags_shouldFetchAllFormsIfNoTagsAreProvided() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); when(formService.getAllForms()).thenReturn(forms); AvailableForms availableFormByTags = formController.getAvailableFormByTags(new ArrayList<String>()); ass...
public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); }
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
FormController { public AvailableForms getAvailableFormByTags(List<String> tagsUuid) throws FormFetchException { return getAvailableFormByTags(tagsUuid, false); } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTemplateByUuid(String fo...
@Test public void downloadAllForms_shouldDownloadAllForms() throws IOException, FormController.FormFetchException { List<Form> forms = new ArrayList<>(); when(formService.downloadFormsByName(StringUtils.EMPTY)).thenReturn(forms); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_FORMS)).thenReturn(mockDate); assertT...
public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_FORMS, sntpService...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
@Test public void shouldCheckForLastSynTimeOfFormWhenDownloadingAllForms() throws Exception, FormController.FormFetchException { when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_FORMS)).thenReturn(mockDate); formController.downloadAllForms(); verify(lastSyncTimeService).getLastSyncTimeFor(DOWNLOAD_FORMS); verify(fo...
public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_FORMS, sntpService...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
@Test public void shouldUpdateLastSyncTimeAfterDownloadingAllForms() throws Exception, FormController.FormFetchException { Date mockDate = mock(Date.class); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_FORMS)).thenReturn(mockDate); Date otherMockDate = mock(Date.class); when(sntpService.getTimePerDeviceTimeZone...
public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_FORMS, sntpService...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
@Test(expected = FormController.FormFetchException.class) public void downloadAllForms_shouldThrowExceptionThrownByFormService() throws IOException, FormController.FormFetchException { when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_FORMS)).thenReturn(mockDate); doThrow(new IOException()).when(formService).downloa...
public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_FORMS, sntpService...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
FormController { public List<Form> downloadAllForms() throws FormFetchException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(APIName.DOWNLOAD_FORMS); List<Form> forms = formService.downloadFormsByName(StringUtils.EMPTY, lastSyncDate); LastSyncTime lastSyncTime = new LastSyncTime(APIName.DOWNLOAD_F...
@Test public void downloadFormTemplateByUuid_shouldDownloadFormByUuid() throws IOException, FormController.FormFetchException { FormTemplate formTemplate = new FormTemplate(); String uuid = "uuid"; when(formService.downloadFormTemplateByUuid(uuid)).thenReturn(formTemplate); assertThat(formController.downloadFormTemplat...
public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByU...
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByU...
@Test(expected = FormController.FormFetchException.class) public void downloadFormTemplateByUuid_shouldThrowFormFetchExceptionIfExceptionThrownByFormService() throws IOException, FormController.FormFetchException { String uuid = "uuid"; doThrow(new IOException()).when(formService).downloadFormTemplateByUuid(uuid); form...
public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByU...
FormController { public FormTemplate downloadFormTemplateByUuid(String uuid) throws FormFetchException { try { return formService.downloadFormTemplateByUuid(uuid); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByU...
@Test public void saveAllForms_shouldSaveAllForm() throws FormController.FormSaveException, IOException { List<Form> forms = buildForms(); formController.saveAllForms(forms); verify(formService).saveForms(forms); verifyNoMoreInteractions(formService); }
public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTe...
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTe...
@Test(expected = FormController.FormSaveException.class) public void saveAllForms_shouldThrowFormSaveExceptionIfExceptionThrownByFormService() throws FormController.FormSaveException, IOException { List<Form> forms = buildForms(); doThrow(new IOException()).when(formService).saveForms(forms); formController.saveAllForm...
public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTe...
FormController { public void saveAllForms(List<Form> forms) throws FormSaveException { try { formService.saveForms(forms); } catch (IOException e) { throw new FormSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTemplate getFormTe...
@Test public void getAllTags_shouldFetchAllUsedTags() throws FormController.FormFetchException, IOException { when(formService.getAllForms()).thenReturn(buildForms()); List<Tag> allTags = formController.getAllTags(); assertThat(allTags.size(), is(5)); assertThat(allTags.get(0).getUuid(), is("tag1")); assertThat(allTags...
public List<Tag> getAllTags() throws FormFetchException { List<Tag> allTags = new ArrayList<>(); List<Form> allForms = null; try { allForms = formService.getAllForms(); } catch (IOException e) { throw new FormFetchException(e); } for (Form form : allForms) { for (Tag tag : form.getTags()) { if (!allTags.contains(tag)) ...
FormController { public List<Tag> getAllTags() throws FormFetchException { List<Tag> allTags = new ArrayList<>(); List<Form> allForms = null; try { allForms = formService.getAllForms(); } catch (IOException e) { throw new FormFetchException(e); } for (Form form : allForms) { for (Tag tag : form.getTags()) { if (!allTag...
FormController { public List<Tag> getAllTags() throws FormFetchException { List<Tag> allTags = new ArrayList<>(); List<Form> allForms = null; try { allForms = formService.getAllForms(); } catch (IOException e) { throw new FormFetchException(e); } for (Form form : allForms) { for (Tag tag : form.getTags()) { if (!allTag...
FormController { public List<Tag> getAllTags() throws FormFetchException { List<Tag> allTags = new ArrayList<>(); List<Form> allForms = null; try { allForms = formService.getAllForms(); } catch (IOException e) { throw new FormFetchException(e); } for (Form form : allForms) { for (Tag tag : form.getTags()) { if (!allTag...
FormController { public List<Tag> getAllTags() throws FormFetchException { List<Tag> allTags = new ArrayList<>(); List<Form> allForms = null; try { allForms = formService.getAllForms(); } catch (IOException e) { throw new FormFetchException(e); } for (Form form : allForms) { for (Tag tag : form.getTags()) { if (!allTag...
@Test public void authenticate_shouldReturnSuccessStatusIfAuthenticated() { String[] credentials = new String[]{"username", "password", "url"}; assertThat(muzimaSyncService.authenticate(credentials), is(SyncStatusConstants.AUTHENTICATION_SUCCESS)); }
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void getAllDownloadedForms_shouldReturnOnlyDownloadedForms() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); when(formService.getAllForms()).thenReturn(forms); when(formService.isFormTemplateDownloaded(forms.get(0).getUuid())).thenReturn(true); DownloadedForms allDo...
public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = formService.getFor...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
@Test public void getAllDownloadedForms_shouldReturnNoFormsIfNoTemplateIsDownloaded() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); when(formService.getAllForms()).thenReturn(forms); when(formService.isFormTemplateDownloaded(anyString())).thenReturn(false); DownloadedForms all...
public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = formService.getFor...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
FormController { public DownloadedForms getAllDownloadedForms() throws FormFetchException { DownloadedForms downloadedFormsByTags = new DownloadedForms(); try { List<Form> allForms = formService.getAllForms(); ArrayList<String> formUuids = getFormListAsPerConfigOrder(); for (String formUuid : formUuids) { Form form = f...
@Test public void isFormDownloaded_shouldReturnTrueIfFromIsDownloaded() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); List<FormTemplate> formTemplates = buildFormTemplates(); when(formService.isFormTemplateDownloaded(anyString())).thenReturn(true); assertThat(formController.is...
public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); int ...
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); int ...
@Test public void isFormDownloaded_shouldReturnFalseIfFromIsNotDownloaded() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); List<FormTemplate> formTemplates = buildFormTemplates(); when(formService.isFormTemplateDownloaded(anyString())).thenReturn(false); assertThat(formControll...
public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); }
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); int ...
FormController { public boolean isFormDownloaded(Form form) throws FormFetchException { boolean downloaded; try { downloaded = formService.isFormTemplateDownloaded(form.getUuid()); } catch (IOException e) { throw new FormFetchException(e); } return downloaded; } FormController(MuzimaApplication muzimaApplication); int ...
@Test public void getFormTemplateByUuid_shouldReturnForm() throws IOException, FormController.FormFetchException { List<FormTemplate> formTemplates = buildFormTemplates(); String uuid = formTemplates.get(0).getUuid(); when(formService.getFormTemplateByUuid(uuid)).thenReturn(formTemplates.get(0)); assertThat(formControl...
public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(St...
FormController { public FormTemplate getFormTemplateByUuid(String formId) throws FormFetchException { try { return formService.getFormTemplateByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(St...
@Test public void getFormByUuid_shouldReturnForm() throws IOException, FormController.FormFetchException { List<Form> forms = buildForms(); String uuid = forms.get(0).getUuid(); when(formService.getFormByUuid(uuid)).thenReturn(forms.get(0)); assertThat(formController.getFormByUuid(uuid), is(forms.get(0))); }
public Form getFormByUuid(String formId) throws FormFetchException { try { return formService.getFormByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } }
FormController { public Form getFormByUuid(String formId) throws FormFetchException { try { return formService.getFormByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } }
FormController { public Form getFormByUuid(String formId) throws FormFetchException { try { return formService.getFormByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public Form getFormByUuid(String formId) throws FormFetchException { try { return formService.getFormByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTempla...
FormController { public Form getFormByUuid(String formId) throws FormFetchException { try { return formService.getFormByUuid(formId); } catch (IOException e) { throw new FormFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String formId); FormTempla...
@Test public void getFormDataByUuid_shouldReturnFormDataForAGivenId() throws Exception, FormController.FormDataFetchException { FormData formData = new FormData(); String uuid = "uuid"; when(formService.getFormDataByUuid(uuid)).thenReturn(formData); assertThat(formController.getFormDataByUuid(uuid), is(formData)); }
public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormB...
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormB...
@Test(expected = FormController.FormDataFetchException.class) public void getFormDataByUuid_shouldThrowFormDataFetchExceptionIfFormServiceThrowAnException() throws Exception, FormController.FormDataFetchException { String uuid = "uuid"; doThrow(new IOException()).when(formService).getFormDataByUuid(uuid); formControlle...
public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormB...
FormController { public FormData getFormDataByUuid(String formDataUuid) throws FormDataFetchException { try { return formService.getFormDataByUuid(formDataUuid); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormB...
@Test public void saveFormData_shouldSaveFormData() throws Exception, FormController.FormDataSaveException { FormData formData = new FormData(); formController.saveFormData(formData); verify(formService).saveFormData(formData); }
public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form get...
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form get...
@Test(expected = FormController.FormDataSaveException.class) public void saveFormData_shouldThrowFormDataSaveExceptionIfExceptionThrownByFormService() throws Exception, FormController.FormDataSaveException { FormData formData = new FormData(); doThrow(new IOException()).when(formService).saveFormData(formData); formCon...
public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form get...
FormController { public void saveFormData(FormData formData) throws FormDataSaveException { try { formData.setSaveTime(new Date()); formService.saveFormData(formData); } catch (IOException e) { throw new FormDataSaveException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form get...
@Test public void authenticate_shouldAuthenticateIfNotAlreadyAuthenticated() throws Exception { String[] credentials = new String[]{"username", "password", "url"}; when(muzimaContext.isAuthenticated()).thenReturn(true); verify(muzimaContext, times(0)).authenticate(anyString(), anyString(), anyString(), anyBoolean()); a...
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void should_find_id_property_class() { Class<? extends Serializable> pkClass = EntityUtils.primaryKeyClass(Tee.class); Assert.assertEquals(TeeId.class, pkClass); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance().primaryKeyIdCl...
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
@Test public void should_find_by_pk() throws Exception { Simple simple = testData.createSimple("testFindByPk"); Simple find = repo.findBy(simple.getId()); assertEquals(simple.getName(), find.getName()); }
@Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : query.hints()) { hints.put(hint.name(), hint.value()); } return entityManager().find(...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
@Test public void should_find__by_pk() throws Exception { Simple simple = testData.createSimple("testFindByPk"); Optional<Simple> find = repo.findOptionalBy(simple.getId()); assertEquals(simple.getName(), find.get().getName()); }
@Override public Optional<E> findOptionalBy(PK primaryKey) { E found = null; try { found = findBy(primaryKey); } catch (Exception e) { } return Optional.ofNullable(found); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Optional<E> findOptionalBy(PK primaryKey) { E found = null; try { found = findBy(primaryKey); } catch (Exception e) { } return Optional.ofNullable(found); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Optional<E> findOptionalBy(PK primaryKey) { E found = null; try { found = findBy(primaryKey); } catch (Exception e) { } return Optional.ofNullable(found); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Optional<E> findOptionalBy(PK primaryKey) { E found = null; try { found = findBy(primaryKey); } catch (Exception e) { } return Optional.ofNullable(found); } @Override @RequiresTransaction E save(E entity); @Override @Re...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Optional<E> findOptionalBy(PK primaryKey) { E found = null; try { found = findBy(primaryKey); } catch (Exception e) { } return Optional.ofNullable(found); } @Override @RequiresTransaction E save(E entity); @Override @Re...
@Test @SuppressWarnings("unchecked") public void should_find_by_example() throws Exception { Simple simple = testData.createSimple("testFindByExample"); List<Simple> find = repo.findBy(simple, Simple_.name); assertNotNull(find); assertFalse(find.isEmpty()); assertEquals(simple.getName(), find.get(0).getName()); }
@Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : query.hints()) { hints.put(hint.name(), hint.value()); } return entityManager().find(...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
@Test @SuppressWarnings("unchecked") public void should_find_by_example_with_start_and_max() throws Exception { Simple simple = testData.createSimple("testFindByExample1", Integer.valueOf(10)); testData.createSimple("testFindByExample1", Integer.valueOf(10)); List<Simple> find = repo.findBy(simple, 0, 1, Simple_.name, ...
@Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : query.hints()) { hints.put(hint.name(), hint.value()); } return entityManager().find(...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
@Test @SuppressWarnings("unchecked") public void should_find_by_example_with_no_attributes() throws Exception { Simple simple = testData.createSimple("testFindByExample"); SingularAttribute<Simple, ?>[] attributes = new SingularAttribute[] {}; List<Simple> find = repo.findBy(simple, attributes); assertNotNull(find); as...
@Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : query.hints()) { hints.put(hint.name(), hint.value()); } return entityManager().find(...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public E findBy(PK primaryKey) { Query query = context.getMethod().getAnnotation(Query.class); if (query != null && query.hints().length > 0) { Map<String, Object> hints = new HashMap<String, Object>(); for (QueryHint hint : qu...
@Test public void should_find_all() { testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); List<Simple> find = repo.findAll(); assertEquals(2, find.size()); }
@SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } @Override @RequiresTransaction E save(E entity); @Override @...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } @Override @RequiresTransaction E save(E entity); @Override @...
@Test public void should_find_by_all_with_start_and_max() { testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); List<Simple> find = repo.findAll(0, 1); assertEquals(1, find.size()); }
@SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } @Override @RequiresTransaction E save(E entity); @Override @...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public List<E> findAll() { return context.applyRestrictions(entityManager().createQuery(allQuery(), entityClass())).getResultList(); } @Override @RequiresTransaction E save(E entity); @Override @...
@Test @SuppressWarnings({ "unchecked" }) public void should_find_by_like() { testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); Simple example = new Simple("test"); List<Simple> find = repo.findByLike(example, Simple_.name); assertEquals(2, find.size()); }
@Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
@Test @SuppressWarnings("unchecked") public void should_find_by_like_with_start_and_max() { testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); Simple example = new Simple("test"); List<Simple> find = repo.findByLike(example, 1, 10, Simple_.name); assertEquals(1, find.size()); }
@Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
@Test @SuppressWarnings("unchecked") public void should_find_by_like_non_string() { testData.createSimple("testFindAll1", 1); testData.createSimple("testFindAll2", 2); Simple example = new Simple("test"); example.setCounter(1); List<Simple> find = repo.findByLike(example, Simple_.name, Simple_.counter); assertEquals(1,...
@Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public List<E> findByLike(E example, SingularAttribute<E, ?>... attributes) { return findByLike(example, -1, -1, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E e...
@Test public void should_find_id_class() { Class<? extends Serializable> pkClass = EntityUtils.primaryKeyClass(Tee2.class); Assert.assertEquals(TeeId.class, pkClass); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance().primaryKeyIdCl...
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
EntityUtils { @SuppressWarnings({ "unchecked", "rawtypes" }) public static Class<? extends Serializable> primaryKeyClass(Class<?> entityClass) { if (entityClass.isAnnotationPresent(IdClass.class)) { return entityClass.getAnnotation(IdClass.class).value(); } Class clazz = PersistenceUnitDescriptorProvider.getInstance()....
@Test public void should_count_all() { testData.createSimple("testCountAll"); Long result = repo.count(); assertEquals(Long.valueOf(1), result); }
@Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
@Test @SuppressWarnings("unchecked") public void should_count_with_attributes() { Simple simple = testData.createSimple("testFindAll1", Integer.valueOf(55)); testData.createSimple("testFindAll2", Integer.valueOf(55)); Long result = repo.count(simple, Simple_.name, Simple_.counter); assertEquals(Long.valueOf(1), result)...
@Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
@Test @SuppressWarnings("unchecked") public void should_count_with_no_attributes() { Simple simple = testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); SingularAttribute<Simple, Object>[] attributes = new SingularAttribute[] {}; Long result = repo.count(simple, attributes); assertEquals(Long....
@Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long count() { return (Long) context.applyRestrictions(entityManager().createQuery(countQuery(), Long.class)) .getSingleResult(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveA...
@Test @SuppressWarnings("unchecked") public void should_count_by_like() { testData.createSimple("testFindAll1"); testData.createSimple("testFindAll2"); Simple example = new Simple("test"); Long count = repo.countLike(example, Simple_.name); assertEquals(Long.valueOf(2), count); }
@Override public Long countLike(E example, SingularAttribute<E, ?>... attributes) { return executeCountQuery(example, true, attributes); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long countLike(E example, SingularAttribute<E, ?>... attributes) { return executeCountQuery(example, true, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long countLike(E example, SingularAttribute<E, ?>... attributes) { return executeCountQuery(example, true, attributes); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long countLike(E example, SingularAttribute<E, ?>... attributes) { return executeCountQuery(example, true, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override public Long countLike(E example, SingularAttribute<E, ?>... attributes) { return executeCountQuery(example, true, attributes); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ...
@Test public void should_remove_and_flush() { Simple simple = testData.createSimple("testRemoveAndFlush"); repo.removeAndFlush(simple); Simple lookup = getEntityManager().find(Simple.class, simple.getId()); assertNull(lookup); }
@Override @RequiresTransaction public void removeAndFlush(E entity) { entityManager().remove(entity); flush(); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override @RequiresTransaction public void removeAndFlush(E entity) { entityManager().remove(entity); flush(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override @RequiresTransaction public void removeAndFlush(E entity) { entityManager().remove(entity); flush(); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override @RequiresTransaction public void removeAndFlush(E entity) { entityManager().remove(entity); flush(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E entity); @Override @Requir...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @Override @RequiresTransaction public void removeAndFlush(E entity) { entityManager().remove(entity); flush(); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E entity); @Override @Requir...
@Test public void should_return_entity_primary_key() { Simple simple = testData.createSimple("should_return_entity_primary_key"); Long id = simple.getId(); Long primaryKey = repo.getPrimaryKey(simple); assertNotNull(primaryKey); assertEquals(id, primaryKey); }
@SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
@Test public void should_return_null_primary_key() { Simple simple = new Simple("should_return_null_primary_key"); Long primaryKey = repo.getPrimaryKey(simple); assertNull(primaryKey); }
@SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
@Test public void should_return_entity_primary_key_detached_entity() { Simple simple = testData.createSimple("should_return_entity_primary_key"); Long id = simple.getId(); getEntityManager().detach(simple); Long primaryKey = repo.getPrimaryKey(simple); assertNotNull(primaryKey); assertEquals(id, primaryKey); }
@SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } }
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
EntityRepositoryHandler implements EntityRepository<E, PK>, DelegateQueryHandler { @SuppressWarnings("unchecked") @Override public PK getPrimaryKey(E entity) { return (PK) persistenceUnitUtil().getIdentifier(entity); } @Override @RequiresTransaction E save(E entity); @Override @RequiresTransaction E saveAndFlush(E ent...
@Test public void should_set_creation_date() throws Exception { AuditedEntity entity = new AuditedEntity(); getEntityManager().persist(entity); getEntityManager().flush(); assertNotNull(entity.getCreated()); assertNotNull(entity.getModified()); assertEquals(entity.getCreated().getTime(), entity.getModified()); }
@PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManager.getReference( bean,...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
@Test public void should_set_modification_date() throws Exception { AuditedEntity entity = new AuditedEntity(); getEntityManager().persist(entity); getEntityManager().flush(); entity = getEntityManager().find(AuditedEntity.class, entity.getId()); entity.setName("test"); getEntityManager().flush(); assertNotNull(entity....
@PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManager.getReference( bean,...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
@Test public void should_accept_entity_class() { boolean isValid = EntityUtils.isEntityClass(Simple.class); Assert.assertTrue(isValid); }
public static boolean isEntityClass(Class<?> entityClass) { return entityClass.isAnnotationPresent(Entity.class) || PersistenceUnitDescriptorProvider.getInstance().isEntity(entityClass); }
EntityUtils { public static boolean isEntityClass(Class<?> entityClass) { return entityClass.isAnnotationPresent(Entity.class) || PersistenceUnitDescriptorProvider.getInstance().isEntity(entityClass); } }
EntityUtils { public static boolean isEntityClass(Class<?> entityClass) { return entityClass.isAnnotationPresent(Entity.class) || PersistenceUnitDescriptorProvider.getInstance().isEntity(entityClass); } private EntityUtils(); }
EntityUtils { public static boolean isEntityClass(Class<?> entityClass) { return entityClass.isAnnotationPresent(Entity.class) || PersistenceUnitDescriptorProvider.getInstance().isEntity(entityClass); } private EntityUtils(); @SuppressWarnings({ "unchecked", "rawtypes" }) static Class<? extends Serializable> primaryKe...
EntityUtils { public static boolean isEntityClass(Class<?> entityClass) { return entityClass.isAnnotationPresent(Entity.class) || PersistenceUnitDescriptorProvider.getInstance().isEntity(entityClass); } private EntityUtils(); @SuppressWarnings({ "unchecked", "rawtypes" }) static Class<? extends Serializable> primaryKe...
@Test public void should_set_changing_principal() { AuditedEntity entity = new AuditedEntity(); getEntityManager().persist(entity); getEntityManager().flush(); entity = getEntityManager().find(AuditedEntity.class, entity.getId()); entity.setName("test"); getEntityManager().flush(); assertNotNull(entity.getChanger()); a...
@PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManager.getReference( bean,...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
@Test public void should_set_creating_principal() { AuditedEntity entity = new AuditedEntity(); getEntityManager().persist(entity); getEntityManager().flush(); assertNotNull(entity.getCreator()); assertEquals(who, entity.getCreator()); assertNotNull(entity.getCreatorPrincipal()); assertEquals(who, entity.getCreatorPrin...
@PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManager.getReference( bean,...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
AuditEntityListener { @PrePersist public void persist(Object entity) { BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(PrePersistAuditListener.class); for (Bean<?> bean : beans) { PrePersistAuditListener result = (PrePersistAuditListener) beanManag...
@Test public void should_set_users_for_creation() { String creator = "creator"; MockPrincipalProvider provider = new MockPrincipalProvider(creator); AuditedEntity entity = new AuditedEntity(); provider.prePersist(entity); assertNotNull(entity.getCreator()); assertNotNull(entity.getCreatorPrincipal()); assertNotNull(ent...
@Override public void prePersist(Object entity) { updatePrincipal(entity, true); }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
@Test public void should_set_users_for_update() { String changer = "changer"; MockPrincipalProvider provider = new MockPrincipalProvider(changer); AuditedEntity entity = new AuditedEntity(); provider.preUpdate(entity); assertNotNull(entity.getChanger()); assertNotNull(entity.getChangerOnly()); assertNotNull(entity.getC...
@Override public void preUpdate(Object entity) { updatePrincipal(entity, false); }
PrincipalProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updatePrincipal(entity, false); } }
PrincipalProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updatePrincipal(entity, false); } }
PrincipalProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updatePrincipal(entity, false); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
PrincipalProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updatePrincipal(entity, false); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
@Test(expected = AuditPropertyException.class) public void should_fail_on_invalid_entity() { PrincipalProviderTest.InvalidEntity entity = new PrincipalProviderTest.InvalidEntity(); new MockPrincipalProvider("").prePersist(entity); fail(); }
@Override public void prePersist(Object entity) { updatePrincipal(entity, true); }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
PrincipalProvider extends AuditProvider { @Override public void prePersist(Object entity) { updatePrincipal(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
@Test public void should_set_dates_for_creation() { AuditedEntity entity = new AuditedEntity(); new TimestampsProvider().prePersist(entity); assertNotNull(entity.getCreated()); assertNotNull(entity.getModified()); assertNull(entity.getGregorianModified()); assertNull(entity.getTimestamp()); }
@Override public void prePersist(Object entity) { updateTimestamps(entity, true); }
TimestampsProvider extends AuditProvider { @Override public void prePersist(Object entity) { updateTimestamps(entity, true); } }
TimestampsProvider extends AuditProvider { @Override public void prePersist(Object entity) { updateTimestamps(entity, true); } }
TimestampsProvider extends AuditProvider { @Override public void prePersist(Object entity) { updateTimestamps(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
TimestampsProvider extends AuditProvider { @Override public void prePersist(Object entity) { updateTimestamps(entity, true); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
@Test public void should_set_dates_for_update() { AuditedEntity entity = new AuditedEntity(); new TimestampsProvider().preUpdate(entity); assertNull(entity.getCreated()); assertNotNull(entity.getModified()); assertNotNull(entity.getGregorianModified()); assertNotNull(entity.getTimestamp()); }
@Override public void preUpdate(Object entity) { updateTimestamps(entity, false); }
TimestampsProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updateTimestamps(entity, false); } }
TimestampsProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updateTimestamps(entity, false); } }
TimestampsProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updateTimestamps(entity, false); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }
TimestampsProvider extends AuditProvider { @Override public void preUpdate(Object entity) { updateTimestamps(entity, false); } @Override void prePersist(Object entity); @Override void preUpdate(Object entity); }