Search in sources :

Example 1 with PatientClient

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());
}
Also used : CachedPatient(org.karnak.backend.cache.CachedPatient) ProjectEntity(org.karnak.backend.data.entity.ProjectEntity) ExternalIDCache(org.karnak.backend.cache.ExternalIDCache) PatientClient(org.karnak.backend.cache.PatientClient) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Test (org.junit.jupiter.api.Test)1 CachedPatient (org.karnak.backend.cache.CachedPatient)1 ExternalIDCache (org.karnak.backend.cache.ExternalIDCache)1 PatientClient (org.karnak.backend.cache.PatientClient)1 ProjectEntity (org.karnak.backend.data.entity.ProjectEntity)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1