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:
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user