diff options
Diffstat (limited to 'src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java')
| -rw-r--r-- | src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java b/src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java index 0ee1ef8..dc75e51 100644 --- a/src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java +++ b/src/test/java/dev/dnpm/oshelper/analyzer/TherapieplanAnalyzerTest.java @@ -19,6 +19,8 @@ package dev.dnpm.oshelper.analyzer; +import static org.mockito.Mockito.*; + import de.itc.onkostar.api.IOnkostarApi; import de.itc.onkostar.api.Procedure; import dev.dnpm.oshelper.services.FormService; @@ -30,35 +32,29 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import static org.mockito.Mockito.*; - @ExtendWith(MockitoExtension.class) class TherapieplanAnalyzerTest { - @Mock - private IOnkostarApi onkostarApi; - - @Mock - private FormService formService; + @Mock private IOnkostarApi onkostarApi; - @Mock - private TherapieplanServiceFactory therapieplanServiceFactory; + @Mock private FormService formService; - private TherapieplanAnalyzer therapieplanAnalyzer; + @Mock private TherapieplanServiceFactory therapieplanServiceFactory; - @BeforeEach - void setUp() { - this.therapieplanAnalyzer = new TherapieplanAnalyzer(therapieplanServiceFactory); - } + private TherapieplanAnalyzer therapieplanAnalyzer; - @Test - void shouldRunServiceMethodsOnAnalyzeCalled() { - when(this.therapieplanServiceFactory.currentUsableInstance()) - .thenReturn(new DefaultTherapieplanService(onkostarApi, formService)); + @BeforeEach + void setUp() { + this.therapieplanAnalyzer = new TherapieplanAnalyzer(therapieplanServiceFactory); + } - this.therapieplanAnalyzer.analyze(new Procedure(onkostarApi), null); + @Test + void shouldRunServiceMethodsOnAnalyzeCalled() { + when(this.therapieplanServiceFactory.currentUsableInstance()) + .thenReturn(new DefaultTherapieplanService(onkostarApi, formService)); - verify(this.therapieplanServiceFactory, times(1)).currentUsableInstance(); - } + this.therapieplanAnalyzer.analyze(new Procedure(onkostarApi), null); + verify(this.therapieplanServiceFactory, times(1)).currentUsableInstance(); + } } |
