use of org.karnak.backend.cache.PatientClient in project karnak by OsiriX-Foundation.
the class ExternalIDGridTest method should_read_cache.
@Test
void should_read_cache() {
// Call constructor
ExternalIDGrid externalIDGrid = new ExternalIDGrid();
// Set cache
PatientClient externalIDCache = new ExternalIDCache();
CachedPatient patient = new CachedPatient("pseudonym", "patientId", "patientFirstName", "patientLastName", "issuerOfPatientId", 1L);
patient.setProjectID(1L);
externalIDCache.put("key", patient);
externalIDGrid.setExternalIDCache(externalIDCache);
// set project
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setId(1L);
externalIDGrid.setProjectEntity(projectEntity);
// Call method
externalIDGrid.readAllCacheValue();
// Test results
assertNotNull(externalIDGrid);
assertNotNull(externalIDGrid.getExternalIDCache());
assertNotNull(externalIDGrid.getProjectEntity());
assertEquals("pseudonym", externalIDGrid.getPatientsListInCache().get(0).getPseudonym());
}
Aggregations