diff options
| author | Paul-Christian Volkmer | 2025-11-16 19:40:56 +0100 |
|---|---|---|
| committer | Paul-Christian Volkmer | 2025-11-17 12:51:19 +0100 |
| commit | 459cb2e4450833362c19194947752190d5f291e5 (patch) | |
| tree | 679c410964da26e0d6f4db09a4e6ce2cdcb3792d /src | |
| parent | b71fa5823a1a71808f0ff546eb86845630948c5a (diff) | |
feat: disable multiple MTS in care plans
This is related to #213.
Diffstat (limited to 'src')
3 files changed, 3 insertions, 21 deletions
diff --git a/src/main/java/dev/dnpm/oshelper/services/therapieplan/MultipleMtbTherapieplanService.java b/src/main/java/dev/dnpm/oshelper/services/therapieplan/MultipleMtbTherapieplanService.java index 78612de..7452530 100644 --- a/src/main/java/dev/dnpm/oshelper/services/therapieplan/MultipleMtbTherapieplanService.java +++ b/src/main/java/dev/dnpm/oshelper/services/therapieplan/MultipleMtbTherapieplanService.java @@ -37,6 +37,7 @@ import java.util.stream.Collectors; import static dev.dnpm.oshelper.services.FormService.hasValue; import static dev.dnpm.oshelper.services.FormService.isYes; +@Deprecated(forRemoval = true, since = "2.0.0") public class MultipleMtbTherapieplanService extends AbstractTherapieplanService { public MultipleMtbTherapieplanService(final IOnkostarApi onkostarApi, final FormService formService) { diff --git a/src/main/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactory.java b/src/main/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactory.java index 2edf3fb..688f424 100644 --- a/src/main/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactory.java +++ b/src/main/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactory.java @@ -32,25 +32,19 @@ public class TherapieplanServiceFactory { private final IOnkostarApi onkostarApi; - private final SettingsService settingsService; - private final FormService formService; + @SuppressWarnings("unused") public TherapieplanServiceFactory( final IOnkostarApi onkostarApi, final SettingsService settingsService, final FormService formService ) { this.onkostarApi = onkostarApi; - this.settingsService = settingsService; this.formService = formService; } public TherapieplanService currentUsableInstance() { - if (settingsService.multipleMtbsInMtbEpisode()) { - return new MultipleMtbTherapieplanService(onkostarApi, formService); - } - return new DefaultTherapieplanService(onkostarApi, formService); } diff --git a/src/test/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactoryTest.java b/src/test/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactoryTest.java index 9b526e2..9ca5517 100644 --- a/src/test/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactoryTest.java +++ b/src/test/java/dev/dnpm/oshelper/services/therapieplan/TherapieplanServiceFactoryTest.java @@ -10,7 +10,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class TherapieplanServiceFactoryTest { @@ -30,20 +29,8 @@ class TherapieplanServiceFactoryTest { } @Test - void testShouldReturnDefaultTherapieplanServiceIfSettingIsFalse() { - when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(false); - + void testShouldAlwaysReturnDefaultTherapieplanService() { var actual = this.therapieplanServiceFactory.currentUsableInstance(); - assertThat(actual).isInstanceOf(DefaultTherapieplanService.class); } - - @Test - void testShouldReturnMultipleMtbTherapieplanServiceIfSettingIsTrue() { - when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(true); - - var actual = this.therapieplanServiceFactory.currentUsableInstance(); - - assertThat(actual).isInstanceOf(MultipleMtbTherapieplanService.class); - } } |
