Test fix
This commit is contained in:
parent
d3e66680f0
commit
090bb30c89
|
@ -6,21 +6,21 @@ import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
import org.mockito.junit.MockitoJUnitRunner;
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.*;
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
@RunWith(MockitoJUnitRunner.class)
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class SearchParamExtractorServiceTest {
|
public class SearchParamExtractorServiceTest {
|
||||||
|
|
||||||
private SearchParamExtractorService mySvc;
|
private SearchParamExtractorService mySvc;
|
||||||
@Autowired
|
@Mock
|
||||||
private IInterceptorBroadcaster myRequestInterceptorBroadcaster;
|
private IInterceptorBroadcaster myRequestInterceptorBroadcaster;
|
||||||
@Autowired
|
@Mock
|
||||||
private IInterceptorBroadcaster myJpaInterceptorBroadcaster;
|
private IInterceptorBroadcaster myJpaInterceptorBroadcaster;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@ -35,6 +35,8 @@ public class SearchParamExtractorServiceTest {
|
||||||
searchParamSet.addWarning("help i'm a bug");
|
searchParamSet.addWarning("help i'm a bug");
|
||||||
searchParamSet.addWarning("Spiff");
|
searchParamSet.addWarning("Spiff");
|
||||||
|
|
||||||
|
when(myJpaInterceptorBroadcaster.callHooks(any(), any())).thenReturn(true);
|
||||||
|
|
||||||
mySvc.handleWarnings(new ServletRequestDetails(myRequestInterceptorBroadcaster), searchParamSet);
|
mySvc.handleWarnings(new ServletRequestDetails(myRequestInterceptorBroadcaster), searchParamSet);
|
||||||
|
|
||||||
verify(myJpaInterceptorBroadcaster, times(2)).callHooks(eq(Pointcut.JPA_PERFTRACE_WARNING), any());
|
verify(myJpaInterceptorBroadcaster, times(2)).callHooks(eq(Pointcut.JPA_PERFTRACE_WARNING), any());
|
||||||
|
|
Loading…
Reference in New Issue