use of brave.spring.webmvc.WebMvcRuntime.WebMvc25 in project brave by openzipkin.
the class WebMvcRuntimeTest method WebMvc25_httpTracing_whenDoesntExist.
@Test(expected = NoSuchBeanDefinitionException.class)
public void WebMvc25_httpTracing_whenDoesntExist() {
ApplicationContext context = mock(ApplicationContext.class);
when(context.containsBean("httpTracing")).thenReturn(false);
new WebMvc25().httpTracing(context);
}
use of brave.spring.webmvc.WebMvcRuntime.WebMvc25 in project brave by openzipkin.
the class WebMvcRuntimeTest method WebMvc25_httpTracing_whenWrongType.
@Test(expected = NoSuchBeanDefinitionException.class)
public void WebMvc25_httpTracing_whenWrongType() {
ApplicationContext context = mock(ApplicationContext.class);
when(context.containsBean("httpTracing")).thenReturn(true);
when(context.getBean("httpTracing")).thenReturn("foo");
new WebMvc25().httpTracing(context);
}
use of brave.spring.webmvc.WebMvcRuntime.WebMvc25 in project brave by openzipkin.
the class WebMvcRuntimeTest method WebMvc25_isHandlerMethod_isFalse.
/**
* Due to HandlerMethod being only present after 3.1, we can't look up the class in 2.5
*/
@Test
public void WebMvc25_isHandlerMethod_isFalse() {
HandlerMethod handlerMethod = mock(HandlerMethod.class);
assertThat(new WebMvc25().isHandlerMethod(handlerMethod)).isFalse();
}
use of brave.spring.webmvc.WebMvcRuntime.WebMvc25 in project brave by openzipkin.
the class WebMvcRuntimeTest method WebMvc25_httpTracing_byName.
/**
* Spring 2.5 cannot get beans by type, so fallback to name
*/
@Test
public void WebMvc25_httpTracing_byName() {
ApplicationContext context = mock(ApplicationContext.class);
when(context.containsBean("httpTracing")).thenReturn(true);
when(context.getBean("httpTracing")).thenReturn(mock(HttpTracing.class));
new WebMvc25().httpTracing(context);
verify(context).containsBean("httpTracing");
verify(context).getBean("httpTracing");
verifyNoMoreInteractions(context);
}
Aggregations