@Test public void applicationContextHasNoBeanWithGivenNameThrowsException() throws Exception { given(applicationContext.getBean(anyString())).willThrow(new NoSuchBeanDefinitionException("Bean not loaded")); exception.expect(DataFilesServiceNotFoundException.class); exception.expectMessage("BDOCDataFilesService not found"); ProxyDocument proxyDocument = mockProxyDocumentWithDocument("filename.bdoc"); dataFilesProxy.getDataFiles(proxyDocument); verify(applicationContext).getBean(anyString()); }
public DataFilesReport getDataFiles(ProxyDocument proxyDocument) { return getServiceForType(extractDocumentType(proxyDocument.getName())).getDataFiles(createDataFilesDocument(proxyDocument)); }
DataFilesProxy { public DataFilesReport getDataFiles(ProxyDocument proxyDocument) { return getServiceForType(extractDocumentType(proxyDocument.getName())).getDataFiles(createDataFilesDocument(proxyDocument)); } }
DataFilesProxy { public DataFilesReport getDataFiles(ProxyDocument proxyDocument) { return getServiceForType(extractDocumentType(proxyDocument.getName())).getDataFiles(createDataFilesDocument(proxyDocument)); }  }
DataFilesProxy { public DataFilesReport getDataFiles(ProxyDocument proxyDocument) { return getServiceForType(extractDocumentType(proxyDocument.getName())).getDataFiles(createDataFilesDocument(proxyDocument)); }  DataFilesReport getDataFiles(ProxyDocument proxyDocument); @Autowired void setApplicationContext(ApplicationContext applicationContext); }
DataFilesProxy { public DataFilesReport getDataFiles(ProxyDocument proxyDocument) { return getServiceForType(extractDocumentType(proxyDocument.getName())).getDataFiles(createDataFilesDocument(proxyDocument)); }  DataFilesReport getDataFiles(ProxyDocument proxyDocument); @Autowired void setApplicationContext(ApplicationContext applicationContext);  }