1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-04 10:02:55 +00:00

Zusätzliche Prüfung auf Formularname vor Consentübernahme hinzugefügt

Diese zusätzliche Prüfung ermöglicht die Erkennung, ob der aktuell ausgewählte
ConsentManagerService die entsprechende Prozedur bearbeiten und Consent-Daten
in das Formular "DNPM-Klinik/Anamnese" übernehmen kann.

Die Standardimplementierung prüft dabei nur, ob die Prozedur nicht `null` ist.
This commit is contained in:
2023-04-04 16:04:54 +02:00
parent c4d9abdf0c
commit 541d2e3a03
5 changed files with 42 additions and 2 deletions

View File

@ -35,6 +35,8 @@ class ConsentManagerTest {
void shouldRunServiceMethodsOnAnalyzeCalled() {
var consentManagerServiceMock = mock(MrConsentManagerService.class);
when(consentManagerServiceMock.canApply(any(Procedure.class))).thenReturn(true);
when(this.consentManagerServiceFactory.currentUsableInstance())
.thenReturn(consentManagerServiceMock);
@ -43,4 +45,18 @@ class ConsentManagerTest {
verify(consentManagerServiceMock, times(1)).applyConsent(any(Procedure.class));
}
@Test
void shouldNotRunServiceMethodsIfProcedureCannotBeAppliesForForm() {
var consentManagerServiceMock = mock(MrConsentManagerService.class);
when(consentManagerServiceMock.canApply(any(Procedure.class))).thenReturn(false);
when(this.consentManagerServiceFactory.currentUsableInstance())
.thenReturn(consentManagerServiceMock);
this.consentManager.analyze(new Procedure(onkostarApi), null);
verify(consentManagerServiceMock, times(0)).applyConsent(any(Procedure.class));
}
}