diff options
| author | Paul-Christian Volkmer | 2025-10-23 11:08:10 +0200 |
|---|---|---|
| committer | Paul-Christian Volkmer | 2025-10-23 11:09:54 +0200 |
| commit | 84fb0d829832bf1628112376bba729422b169402 (patch) | |
| tree | 4828674b77105877dccfcccb380da3f7c0f75987 /src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java | |
| parent | 61e7dfcbe637f401f81ff853e9bd10c90b325acb (diff) | |
refactor: change package name
Diffstat (limited to 'src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java')
| -rw-r--r-- | src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java b/src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java deleted file mode 100644 index b0d76e3..0000000 --- a/src/test/java/dev/dnpm/services/consent/ConsentManagerServiceFactoryTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package dev.dnpm.services.consent; - -import de.itc.onkostar.api.IOnkostarApi; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Map; -import java.util.Set; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class ConsentManagerServiceFactoryTest { - - private IOnkostarApi onkostarApi; - - private ConsentManagerServiceFactory consentManagerServiceFactory; - - @BeforeEach - void setup( - @Mock IOnkostarApi onkostarApi - ) { - this.onkostarApi = onkostarApi; - this.consentManagerServiceFactory = new ConsentManagerServiceFactory(onkostarApi); - } - - private static Set<Map.Entry<String, Class<? extends ConsentManagerService>>> expectedMappings() { - return Map.ofEntries( - Map.entry("MR.Consent", MrConsentManagerService.class), - Map.entry("Excel-Formular", UkwConsentManagerService.class) - ).entrySet(); - } - - @ParameterizedTest - @MethodSource("expectedMappings") - void testShouldMapFormNameToService(Map.Entry<String, Class<?>> expectedMapping) { - when(onkostarApi.getGlobalSetting(anyString())).thenReturn(expectedMapping.getKey()); - - var actual = consentManagerServiceFactory.currentUsableInstance(); - - assertThat(actual).isExactlyInstanceOf(expectedMapping.getValue()); - } - -} |
