mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-03 09:42:54 +00:00
Issue #11: Verwende Überschrift für Fragestellung und Empfehlung
This commit is contained in:
@ -21,7 +21,7 @@ public class OsTumorkonferenzToProtocolMapper implements ProcedureToProtocolMapp
|
|||||||
null != fragestellung && !fragestellung.getString().isBlank()
|
null != fragestellung && !fragestellung.getString().isBlank()
|
||||||
&& null != empfehlung && !empfehlung.getString().isBlank()
|
&& null != empfehlung && !empfehlung.getString().isBlank()
|
||||||
) {
|
) {
|
||||||
return Optional.of(String.format("%s\n%s", fragestellung.getString(), empfehlung.getString()));
|
return Optional.of(String.format("Fragestellung:\n%s\n\nEmpfehlung:\n%s", fragestellung.getString(), empfehlung.getString()));
|
||||||
} else if (null != fragestellung && !fragestellung.getString().isBlank()) {
|
} else if (null != fragestellung && !fragestellung.getString().isBlank()) {
|
||||||
return Optional.of(fragestellung.getString());
|
return Optional.of(fragestellung.getString());
|
||||||
} else if (null != empfehlung && !empfehlung.getString().isBlank()) {
|
} else if (null != empfehlung && !empfehlung.getString().isBlank()) {
|
||||||
|
@ -24,14 +24,14 @@ public class OsTumorkonferenzVarianteUkwToProtocolMapper implements ProcedureToP
|
|||||||
null != fragestellung && !fragestellung.getString().isBlank()
|
null != fragestellung && !fragestellung.getString().isBlank()
|
||||||
&& null != empfehlung && !empfehlung.getString().isBlank()
|
&& null != empfehlung && !empfehlung.getString().isBlank()
|
||||||
) {
|
) {
|
||||||
return String.format("%s\n%s", fragestellung.getString(), empfehlung.getString());
|
return String.format("Fragestellung:\n%s\n\nEmpfehlung:\n%s", fragestellung.getString().trim(), empfehlung.getString().trim());
|
||||||
} else if (null != fragestellung && !fragestellung.getString().isBlank()) {
|
} else if (null != fragestellung && !fragestellung.getString().isBlank()) {
|
||||||
return fragestellung.getString();
|
return fragestellung.getString().trim();
|
||||||
} else if (null != empfehlung && !empfehlung.getString().isBlank()) {
|
} else if (null != empfehlung && !empfehlung.getString().isBlank()) {
|
||||||
return empfehlung.getString();
|
return empfehlung.getString().trim();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}).collect(Collectors.joining("\n"));
|
}).collect(Collectors.joining("\n\n"));
|
||||||
|
|
||||||
if (!result.isBlank()) {
|
if (!result.isBlank()) {
|
||||||
return Optional.of(result);
|
return Optional.of(result);
|
||||||
|
@ -22,22 +22,24 @@ import static org.mockito.Mockito.when;
|
|||||||
@ExtendWith(MockitoExtension.class)
|
@ExtendWith(MockitoExtension.class)
|
||||||
public class DefaultMtbServiceTest {
|
public class DefaultMtbServiceTest {
|
||||||
|
|
||||||
@Mock
|
|
||||||
private IOnkostarApi onkostarApi;
|
private IOnkostarApi onkostarApi;
|
||||||
|
|
||||||
@Mock
|
|
||||||
private SettingsService settingsService;
|
private SettingsService settingsService;
|
||||||
|
|
||||||
private DefaultMtbService service;
|
private DefaultMtbService service;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setup() {
|
void setup(
|
||||||
|
@Mock IOnkostarApi onkostarApi,
|
||||||
|
@Mock SettingsService settingsService
|
||||||
|
) {
|
||||||
|
this.onkostarApi = onkostarApi;
|
||||||
|
this.settingsService = settingsService;
|
||||||
this.service = new DefaultMtbService(settingsService);
|
this.service = new DefaultMtbService(settingsService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testShouldReturnMtbProtocolForDefaultImplementation() {
|
void testShouldReturnMtbProtocolForDefaultImplementation() {
|
||||||
|
|
||||||
when(settingsService.getSID()).thenReturn(Optional.of("12345"));
|
when(settingsService.getSID()).thenReturn(Optional.of("12345"));
|
||||||
when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(false);
|
when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(false);
|
||||||
|
|
||||||
@ -53,12 +55,11 @@ public class DefaultMtbServiceTest {
|
|||||||
|
|
||||||
var actual = service.getProtocol(procedures);
|
var actual = service.getProtocol(procedures);
|
||||||
|
|
||||||
assertThat(actual).isEqualTo("Test ok?\nRerun Test if not ok!");
|
assertThat(actual).isEqualTo("Fragestellung:\nTest ok?\n\nEmpfehlung:\nRerun Test if not ok!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testShouldReturnEmptyMtbProtocolForMultipleMtb() {
|
void testShouldReturnEmptyMtbProtocolForMultipleMtb() {
|
||||||
|
|
||||||
when(settingsService.getSID()).thenReturn(Optional.of("12345"));
|
when(settingsService.getSID()).thenReturn(Optional.of("12345"));
|
||||||
when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(true);
|
when(settingsService.multipleMtbsInMtbEpisode()).thenReturn(true);
|
||||||
|
|
||||||
@ -103,7 +104,8 @@ public class DefaultMtbServiceTest {
|
|||||||
var actual = service.getProtocol(procedures);
|
var actual = service.getProtocol(procedures);
|
||||||
|
|
||||||
assertThat(actual).isEqualTo(
|
assertThat(actual).isEqualTo(
|
||||||
"Test ok?\nRerun Test if not ok!\nTest immer noch ok?\nDo not rerun Test if ok!"
|
"Fragestellung:\nTest ok?\n\nEmpfehlung:\nRerun Test if not ok!\n\n" +
|
||||||
|
"Fragestellung:\nTest immer noch ok?\n\nEmpfehlung:\nDo not rerun Test if ok!"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user