1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-03 17:52:53 +00:00

Issue #29: Backend-Service für ECOG-Status hinzugefügt

This commit is contained in:
2023-07-12 10:11:11 +02:00
parent 21c02ac068
commit a6238c14e3
2 changed files with 36 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package DNPM;
import DNPM.services.systemtherapie.SystemtherapieService;
import de.itc.onkostar.api.IOnkostarApi;
import de.itc.onkostar.api.Item;
import de.itc.onkostar.api.Patient;
import de.itc.onkostar.api.Procedure;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
@ -245,6 +246,23 @@ class DNPMHelperTest {
assertThat(argumentCaptor.getValue()).contains("WHERE patient_id = 2 AND geloescht = 0");
}
@Test
void testShouldReturnEcogStatusList() {
doAnswer(invocationOnMock -> {
var id = invocationOnMock.getArgument(0, Integer.class);
var patient = new Patient(onkostarApi);
patient.setId(id);
return patient;
}).when(onkostarApi).getPatient(anyInt());
dnpmHelper.getEcogStatus(Map.of("PatientId", 42));
var argumentCaptor = ArgumentCaptor.forClass(Patient.class);
verify(systemtherapieService, times(1)).ecogSatus(argumentCaptor.capture());
assertThat(argumentCaptor.getValue()).isNotNull();
assertThat(argumentCaptor.getValue().getId()).isEqualTo(42);
}
}
}