{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/2516","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/2516/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/2516/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/2516/events","html_url":"https://github.com/spring-projects/spring-boot/issues/2516","id":57975894,"number":2516,"title":"SpringApplicationContextLoader does not detect default XML config files or Groovy scripts","user":{"login":"sbrannen","id":104798,"avatar_url":"https://avatars.githubusercontent.com/u/104798?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrannen","html_url":"https://github.com/sbrannen","followers_url":"https://api.github.com/users/sbrannen/followers","following_url":"https://api.github.com/users/sbrannen/following{/other_user}","gists_url":"https://api.github.com/users/sbrannen/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrannen/subscriptions","organizations_url":"https://api.github.com/users/sbrannen/orgs","repos_url":"https://api.github.com/users/sbrannen/repos","events_url":"https://api.github.com/users/sbrannen/events{/privacy}","received_events_url":"https://api.github.com/users/sbrannen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"snicoll","id":490484,"avatar_url":"https://avatars.githubusercontent.com/u/490484?v=3","gravatar_id":"","url":"https://api.github.com/users/snicoll","html_url":"https://github.com/snicoll","followers_url":"https://api.github.com/users/snicoll/followers","following_url":"https://api.github.com/users/snicoll/following{/other_user}","gists_url":"https://api.github.com/users/snicoll/gists{/gist_id}","starred_url":"https://api.github.com/users/snicoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snicoll/subscriptions","organizations_url":"https://api.github.com/users/snicoll/orgs","repos_url":"https://api.github.com/users/snicoll/repos","events_url":"https://api.github.com/users/snicoll/events{/privacy}","received_events_url":"https://api.github.com/users/snicoll/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/46","html_url":"https://github.com/spring-projects/spring-boot/milestones/1.3.0.RC1","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/46/labels","id":1272991,"number":46,"title":"1.3.0.RC1","description":"","creator":{"login":"snicoll","id":490484,"avatar_url":"https://avatars.githubusercontent.com/u/490484?v=3","gravatar_id":"","url":"https://api.github.com/users/snicoll","html_url":"https://github.com/snicoll","followers_url":"https://api.github.com/users/snicoll/followers","following_url":"https://api.github.com/users/snicoll/following{/other_user}","gists_url":"https://api.github.com/users/snicoll/gists{/gist_id}","starred_url":"https://api.github.com/users/snicoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snicoll/subscriptions","organizations_url":"https://api.github.com/users/snicoll/orgs","repos_url":"https://api.github.com/users/snicoll/repos","events_url":"https://api.github.com/users/snicoll/events{/privacy}","received_events_url":"https://api.github.com/users/snicoll/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":43,"state":"open","created_at":"2015-08-26T08:18:13Z","updated_at":"2015-09-29T22:32:09Z","due_on":"2015-10-06T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-02-17T20:17:18Z","updated_at":"2015-09-29T22:36:47Z","closed_at":"2015-09-29T02:35:42Z","body":"`SpringApplicationContextLoader.processContextConfiguration(ContextConfigurationAttributes)` currently only supports detection of default `@Configuration` classes.\r\n\r\nSince `SpringApplicationContextLoader` is a hybrid context loader with support for annotated classes, XML configuration files, and Groovy scripts as _sources_ for the `SpringApplication`, the loader should auto-detect defaults for all supported types just like the core behavior of the Spring TestContext Framework. This should be achievable by making the following (untested) changes.\r\n\r\n\t@Override\r\n\tprotected String[] getResourceSuffixes() {\r\n\t\treturn new String[] { \"-context.xml\", \"Context.groovy\" };\r\n\t}\r\n\r\n\t@Override\r\n\tprotected String getResourceSuffix() {\r\n\t\tthrow new UnsupportedOperationException(\r\n\t\t\t\"SpringApplicationContextLoader does not support the getResourceSuffix() method\");\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void processContextConfiguration(ContextConfigurationAttributes configAttributes) {\r\n\t\tsuper.processContextConfiguration(configAttributes);\r\n\r\n\t\t// Neither XML nor Groovy default detected?\r\n\t\tif (!configAttributes.hasResources() && isGenerateDefaultLocations()) {\r\n\t\t\tClass<?>[] defaultConfigClasses = detectDefaultConfigurationClasses(configAttributes\r\n\t\t\t\t\t.getDeclaringClass());\r\n\t\t\tconfigAttributes.setClasses(defaultConfigClasses);\r\n\t\t}\r\n\t}\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/144210224","html_url":"https://github.com/spring-projects/spring-boot/issues/2516#issuecomment-144210224","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/2516","id":144210224,"user":{"login":"sbrannen","id":104798,"avatar_url":"https://avatars.githubusercontent.com/u/104798?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrannen","html_url":"https://github.com/sbrannen","followers_url":"https://api.github.com/users/sbrannen/followers","following_url":"https://api.github.com/users/sbrannen/following{/other_user}","gists_url":"https://api.github.com/users/sbrannen/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrannen/subscriptions","organizations_url":"https://api.github.com/users/sbrannen/orgs","repos_url":"https://api.github.com/users/sbrannen/repos","events_url":"https://api.github.com/users/sbrannen/events{/privacy}","received_events_url":"https://api.github.com/users/sbrannen/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T22:36:47Z","updated_at":"2015-09-29T22:36:47Z","body":"Thanks, @philwebb!"}}