WebMvcRuntime { abstract HttpTracing httpTracing(ApplicationContext ctx); WebMvcRuntime();   }
@Test public void WebMvc31_httpTracing_byType() { ApplicationContext context = mock(ApplicationContext.class); new WebMvc31().httpTracing(context); verify(context).getBean(HttpTracing.class); verifyNoMoreInteractions(context); }
@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); }
@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); }
@Test(expected = NoSuchBeanDefinitionException.class) public void WebMvc25_httpTracing_whenDoesntExist() { ApplicationContext context = mock(ApplicationContext.class); when(context.containsBean("httpTracing")).thenReturn(false); new WebMvc25().httpTracing(context); }