1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-03 01:32:55 +00:00

Testcode aufgeräumt

This commit is contained in:
2023-04-01 21:28:07 +02:00
parent 82ab2234e8
commit 3627a9e898
16 changed files with 56 additions and 64 deletions

View File

@ -20,7 +20,7 @@ import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
public class DefaultSystemtherapieServiceTest {
class DefaultSystemtherapieServiceTest {
private IOnkostarApi onkostarApi;
@ -29,20 +29,14 @@ public class DefaultSystemtherapieServiceTest {
private DefaultSystemtherapieService service;
@BeforeEach
void setup(
@Mock IOnkostarApi onkostarApi,
@Mock SettingsService settingsService
) {
void setup(@Mock IOnkostarApi onkostarApi, @Mock SettingsService settingsService) {
this.onkostarApi = onkostarApi;
this.settingsService = settingsService;
this.service = new DefaultSystemtherapieService(onkostarApi, settingsService);
}
private static Set<Map.Entry<String, Class<OsSystemischeTherapieToProzedurwerteMapper>>> expectedMapperMappings() {
return Map.ofEntries(
Map.entry("OS.Systemische Therapie", OsSystemischeTherapieToProzedurwerteMapper.class),
Map.entry("OS.Systemische Therapie.VarianteUKW", OsSystemischeTherapieToProzedurwerteMapper.class)
).entrySet();
return Map.ofEntries(Map.entry("OS.Systemische Therapie", OsSystemischeTherapieToProzedurwerteMapper.class), Map.entry("OS.Systemische Therapie.VarianteUKW", OsSystemischeTherapieToProzedurwerteMapper.class)).entrySet();
}
@ParameterizedTest
@ -57,11 +51,7 @@ public class DefaultSystemtherapieServiceTest {
}
private static Set<Map.Entry<String, String>> expectedFormnameMappings() {
return Map.ofEntries(
Map.entry("2011", "OS.Systemische Therapie.VarianteUKW"),
Map.entry("20119", "OS.Systemische Therapie.VarianteUKW"),
Map.entry("Defaultwert", "OS.Systemische Therapie")
).entrySet();
return Map.ofEntries(Map.entry("2011", "OS.Systemische Therapie.VarianteUKW"), Map.entry("20119", "OS.Systemische Therapie.VarianteUKW"), Map.entry("Defaultwert", "OS.Systemische Therapie")).entrySet();
}
@ParameterizedTest
@ -83,8 +73,9 @@ public class DefaultSystemtherapieServiceTest {
var actual = service.getSystemischeTherapienFromDiagnose(1);
assertThat(actual).isNotNull();
assertThat(actual).isExactlyInstanceOf(ArrayList.class);
assertThat(actual).hasSize(1);
assertThat(actual)
.isNotNull()
.isExactlyInstanceOf(ArrayList.class)
.hasSize(1);
}
}