@Test public void applicationContextHasNoBeanWithGivenNameThrowsException() throws Exception { BDDMockito.given(applicationContext.getBean(anyString())).willThrow(new NoSuchBeanDefinitionException("Bean not loaded")); exception.expect(ValidatonServiceNotFoundException.class); exception.expectMessage("genericValidationService not found"); ProxyDocument proxyDocument = mockProxyDocumentWithDocument(DocumentType.PDF); validationProxy.validate(proxyDocument); verify(applicationContext).getBean(anyString()); }
public SimpleReport validate(ProxyRequest proxyRequest) { long validationStartTime = System.nanoTime(); SimpleReport report = validateRequest(proxyRequest); long validationDuration = System.nanoTime() - validationStartTime; publishStatistics(proxyRequest, report, validationDuration); addWarningForTestEnvironment(report); return report; }
ValidationProxy { public SimpleReport validate(ProxyRequest proxyRequest) { long validationStartTime = System.nanoTime(); SimpleReport report = validateRequest(proxyRequest); long validationDuration = System.nanoTime() - validationStartTime; publishStatistics(proxyRequest, report, validationDuration); addWarningForTestEnvironment(report); return report; } }
ValidationProxy { public SimpleReport validate(ProxyRequest proxyRequest) { long validationStartTime = System.nanoTime(); SimpleReport report = validateRequest(proxyRequest); long validationDuration = System.nanoTime() - validationStartTime; publishStatistics(proxyRequest, report, validationDuration); addWarningForTestEnvironment(report); return report; } @Autowired  ValidationProxy(StatisticsService statisticsService, ApplicationContext applicationContext, Environment environment); }
ValidationProxy { public SimpleReport validate(ProxyRequest proxyRequest) { long validationStartTime = System.nanoTime(); SimpleReport report = validateRequest(proxyRequest); long validationDuration = System.nanoTime() - validationStartTime; publishStatistics(proxyRequest, report, validationDuration); addWarningForTestEnvironment(report); return report; } @Autowired  ValidationProxy(StatisticsService statisticsService, ApplicationContext applicationContext, Environment environment); SimpleReport validate(ProxyRequest proxyRequest); }
ValidationProxy { public SimpleReport validate(ProxyRequest proxyRequest) { long validationStartTime = System.nanoTime(); SimpleReport report = validateRequest(proxyRequest); long validationDuration = System.nanoTime() - validationStartTime; publishStatistics(proxyRequest, report, validationDuration); addWarningForTestEnvironment(report); return report; } @Autowired  ValidationProxy(StatisticsService statisticsService, ApplicationContext applicationContext, Environment environment); SimpleReport validate(ProxyRequest proxyRequest);  }