{"action":"created","comment":{"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/comments/90635416","pull_request_review_id":11154182,"id":90635416,"diff_hunk":"@@ -19,23 +19,36 @@\n \n import com.google.common.collect.ImmutableMap;\n import com.rometools.rome.feed.atom.Feed;\n+import fi.helsinki.opintoni.config.AppConfiguration;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.http.MediaType;\n+import org.springframework.http.converter.feed.AtomFeedHttpMessageConverter;\n+import org.springframework.stereotype.Component;\n import org.springframework.web.client.RestTemplate;\n import org.springframework.web.util.UriComponentsBuilder;\n \n+import java.util.Collections;\n import java.util.Locale;\n \n+@Component\n public class FlammaRestClient {\n+    private final static Logger log = LoggerFactory.getLogger(FlammaRestClient.class);\n \n     private final String baseUrl;\n     private final RestTemplate restTemplate;\n \n+    @Autowired\n+    private AppConfiguration appConfiguration;\n+\n     private final ImmutableMap<String, String> studentFeedsByLocale;\n     private final ImmutableMap<String, String> teacherFeedsByLocale;\n-    private final ImmutableMap<String, String> studentOpenUniversityFeedsByLocale;\n \n-    public FlammaRestClient(String baseUrl, RestTemplate restTemplate) {\n-        this.baseUrl = baseUrl;\n-        this.restTemplate = restTemplate;\n+    @Autowired\n+    public FlammaRestClient(AppConfiguration appConfiguration) {\n+        this.baseUrl = appConfiguration.get(\"flamma.base.url\");\n+        this.restTemplate = initializeRestTemplate();","path":"app/src/main/java/fi/helsinki/opintoni/integration/flamma/FlammaRestClient.java","position":37,"original_position":37,"commit_id":"6aec84c95387f83644048044f9d79ef67e60f609","original_commit_id":"6aec84c95387f83644048044f9d79ef67e60f609","user":{"login":"hheiskanen","id":6654979,"avatar_url":"https://avatars.githubusercontent.com/u/6654979?v=3","gravatar_id":"","url":"https://api.github.com/users/hheiskanen","html_url":"https://github.com/hheiskanen","followers_url":"https://api.github.com/users/hheiskanen/followers","following_url":"https://api.github.com/users/hheiskanen/following{/other_user}","gists_url":"https://api.github.com/users/hheiskanen/gists{/gist_id}","starred_url":"https://api.github.com/users/hheiskanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hheiskanen/subscriptions","organizations_url":"https://api.github.com/users/hheiskanen/orgs","repos_url":"https://api.github.com/users/hheiskanen/repos","events_url":"https://api.github.com/users/hheiskanen/events{/privacy}","received_events_url":"https://api.github.com/users/hheiskanen/received_events","type":"User","site_admin":false},"body":"Voisi ehkä tehdä sijoituksen `this.restTemplate`en tuolla `initializeRestTemplate`-metodissa, kun nythän toi metodi luo uuden restTemplaten, mutta ei alusta sitä ko. instanssille. Tai vaihtoehtoisesti nimeää ton initialize-metodin vaikka `createRestTemplate`ksi.","created_at":"2016-12-02T12:40:33Z","updated_at":"2016-12-02T12:50:40Z","html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92#discussion_r90635416","pull_request_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92","_links":{"self":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/comments/90635416"},"html":{"href":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92#discussion_r90635416"},"pull_request":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92"}}},"pull_request":{"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92","id":96106828,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92","diff_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92.diff","patch_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92.patch","issue_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/92","number":92,"state":"open","locked":false,"title":"Changed the source of Open University's news","user":{"login":"jiivonen","id":2620356,"avatar_url":"https://avatars.githubusercontent.com/u/2620356?v=3","gravatar_id":"","url":"https://api.github.com/users/jiivonen","html_url":"https://github.com/jiivonen","followers_url":"https://api.github.com/users/jiivonen/followers","following_url":"https://api.github.com/users/jiivonen/following{/other_user}","gists_url":"https://api.github.com/users/jiivonen/gists{/gist_id}","starred_url":"https://api.github.com/users/jiivonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiivonen/subscriptions","organizations_url":"https://api.github.com/users/jiivonen/orgs","repos_url":"https://api.github.com/users/jiivonen/repos","events_url":"https://api.github.com/users/jiivonen/events{/privacy}","received_events_url":"https://api.github.com/users/jiivonen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-01T15:13:07Z","updated_at":"2016-12-02T12:50:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23674dc274bb0ed1393ef0741cef687f20cc7910","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92/commits","review_comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92/comments","review_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/92/comments","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/statuses/6aec84c95387f83644048044f9d79ef67e60f609","head":{"label":"UH-StudentServices:oo799-open-university-rss","ref":"oo799-open-university-rss","sha":"6aec84c95387f83644048044f9d79ef67e60f609","user":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"repo":{"id":46273704,"name":"mystudies-myteaching-backend","full_name":"UH-StudentServices/mystudies-myteaching-backend","owner":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend","description":null,"fork":false,"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend","forks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/forks","keys_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/teams","hooks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/hooks","issue_events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/events{/number}","events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/events","assignees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/assignees{/user}","branches_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/branches{/branch}","tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/tags","blobs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/languages","stargazers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/stargazers","contributors_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/contributors","subscribers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/subscribers","subscription_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/subscription","commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/contents/{+path}","compare_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/merges","archive_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/downloads","issues_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues{/number}","pulls_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/labels{/name}","releases_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/releases{/id}","deployments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/deployments","created_at":"2015-11-16T12:38:03Z","updated_at":"2016-10-25T05:30:51Z","pushed_at":"2016-12-02T12:28:49Z","git_url":"git://github.com/UH-StudentServices/mystudies-myteaching-backend.git","ssh_url":"git@github.com:UH-StudentServices/mystudies-myteaching-backend.git","clone_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend.git","svn_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend","homepage":null,"size":5213,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"develop"}},"base":{"label":"UH-StudentServices:develop","ref":"develop","sha":"70f5ee655b8150d41a08b36bb8a2d9f9a85acc4e","user":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"repo":{"id":46273704,"name":"mystudies-myteaching-backend","full_name":"UH-StudentServices/mystudies-myteaching-backend","owner":{"login":"UH-StudentServices","id":11271527,"avatar_url":"https://avatars.githubusercontent.com/u/11271527?v=3","gravatar_id":"","url":"https://api.github.com/users/UH-StudentServices","html_url":"https://github.com/UH-StudentServices","followers_url":"https://api.github.com/users/UH-StudentServices/followers","following_url":"https://api.github.com/users/UH-StudentServices/following{/other_user}","gists_url":"https://api.github.com/users/UH-StudentServices/gists{/gist_id}","starred_url":"https://api.github.com/users/UH-StudentServices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UH-StudentServices/subscriptions","organizations_url":"https://api.github.com/users/UH-StudentServices/orgs","repos_url":"https://api.github.com/users/UH-StudentServices/repos","events_url":"https://api.github.com/users/UH-StudentServices/events{/privacy}","received_events_url":"https://api.github.com/users/UH-StudentServices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend","description":null,"fork":false,"url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend","forks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/forks","keys_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/teams","hooks_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/hooks","issue_events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/events{/number}","events_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/events","assignees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/assignees{/user}","branches_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/branches{/branch}","tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/tags","blobs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/languages","stargazers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/stargazers","contributors_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/contributors","subscribers_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/subscribers","subscription_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/subscription","commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/contents/{+path}","compare_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/merges","archive_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/downloads","issues_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues{/number}","pulls_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/labels{/name}","releases_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/releases{/id}","deployments_url":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/deployments","created_at":"2015-11-16T12:38:03Z","updated_at":"2016-10-25T05:30:51Z","pushed_at":"2016-12-02T12:28:49Z","git_url":"git://github.com/UH-StudentServices/mystudies-myteaching-backend.git","ssh_url":"git@github.com:UH-StudentServices/mystudies-myteaching-backend.git","clone_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend.git","svn_url":"https://github.com/UH-StudentServices/mystudies-myteaching-backend","homepage":null,"size":5213,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92"},"html":{"href":"https://github.com/UH-StudentServices/mystudies-myteaching-backend/pull/92"},"issue":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/92"},"comments":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/UH-StudentServices/mystudies-myteaching-backend/statuses/6aec84c95387f83644048044f9d79ef67e60f609"}}}}
{"actor":{"display_login":"hheiskanen"}}