{"action":"created","comment":{"url":"https://api.github.com/repos/Netflix/eureka/pulls/comments/39902453","id":39902453,"diff_hunk":"@@ -0,0 +1,68 @@\n+package com.netflix.eureka.util;\n+\n+import com.netflix.appinfo.AmazonInfo;\n+import com.netflix.appinfo.ApplicationInfoManager;\n+import com.netflix.appinfo.InstanceInfo;\n+import com.netflix.appinfo.LeaseInfo;\n+import com.netflix.appinfo.MyDataCenterInstanceConfig;\n+import com.netflix.config.ConfigurationManager;\n+import com.netflix.discovery.DefaultEurekaClientConfig;\n+import com.netflix.discovery.DiscoveryClient;\n+import com.netflix.eureka.DefaultEurekaServerConfig;\n+import com.netflix.eureka.EurekaServerConfig;\n+import com.netflix.eureka.registry.PeerAwareInstanceRegistry;\n+import com.netflix.eureka.aws.AwsAsgUtil;\n+import org.junit.After;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import java.util.UUID;\n+\n+import static org.mockito.Mockito.mock;\n+import static org.mockito.Mockito.spy;\n+\n+/**\n+ * @author David Liu\n+ */\n+public class AwsAsgUtilTest {\n+\n+    private ApplicationInfoManager applicationInfoManager;\n+    private PeerAwareInstanceRegistry registry;\n+    private DiscoveryClient client;\n+    private AwsAsgUtil awsAsgUtil;\n+\n+    @Before\n+    public void setUp() throws Exception {\n+        ConfigurationManager.getConfigInstance().setProperty(\"eureka.awsAccessId\", \"fakeId\");\n+        ConfigurationManager.getConfigInstance().setProperty(\"eureka.awsSecretKey\", \"fakeKey\");\n+\n+        AmazonInfo dataCenterInfo = mock(AmazonInfo.class);\n+\n+        EurekaServerConfig serverConfig = new DefaultEurekaServerConfig();\n+        InstanceInfo.Builder builder = InstanceInfo.Builder.newBuilder();\n+        builder.setIPAddr(\"10.10.101.00\");\n+        builder.setHostName(\"fakeHost\");\n+        builder.setAppName(\"fake-\" + UUID.randomUUID());\n+        builder.setLeaseInfo(LeaseInfo.Builder.newBuilder().build());\n+        builder.setDataCenterInfo(dataCenterInfo);\n+\n+        applicationInfoManager = new ApplicationInfoManager(new MyDataCenterInstanceConfig(), builder.build());\n+        DefaultEurekaClientConfig clientConfig = new DefaultEurekaClientConfig();\n+        // setup config in advance, used in initialize converter\n+        client = mock(DiscoveryClient.class);\n+        registry = mock(PeerAwareInstanceRegistry.class);\n+\n+        awsAsgUtil = spy(new AwsAsgUtil(serverConfig, clientConfig, registry));\n+    }\n+\n+    @After\n+    public void tearDown() throws Exception {\n+        ConfigurationManager.getConfigInstance().clear();\n+    }\n+\n+    @Test\n+    public void testAsyncLoadingFromCache() {\n+","path":"eureka-core/src/test/java/com/netflix/eureka/util/AwsAsgUtilTest.java","position":65,"original_position":65,"commit_id":"efdab4b7266dee0c63cc906fc6c5a762c7992b16","original_commit_id":"efdab4b7266dee0c63cc906fc6c5a762c7992b16","user":{"login":"qiangdavidliu","id":6243760,"avatar_url":"https://avatars.githubusercontent.com/u/6243760?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangdavidliu","html_url":"https://github.com/qiangdavidliu","followers_url":"https://api.github.com/users/qiangdavidliu/followers","following_url":"https://api.github.com/users/qiangdavidliu/following{/other_user}","gists_url":"https://api.github.com/users/qiangdavidliu/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangdavidliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangdavidliu/subscriptions","organizations_url":"https://api.github.com/users/qiangdavidliu/orgs","repos_url":"https://api.github.com/users/qiangdavidliu/repos","events_url":"https://api.github.com/users/qiangdavidliu/events{/privacy}","received_events_url":"https://api.github.com/users/qiangdavidliu/received_events","type":"User","site_admin":false},"body":"Urg must have forgotten to do this last time I added the test class.","created_at":"2015-09-18T21:21:43Z","updated_at":"2015-09-18T21:21:43Z","html_url":"https://github.com/Netflix/eureka/pull/644#discussion_r39902453","pull_request_url":"https://api.github.com/repos/Netflix/eureka/pulls/644","_links":{"self":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/comments/39902453"},"html":{"href":"https://github.com/Netflix/eureka/pull/644#discussion_r39902453"},"pull_request":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/644"}}},"pull_request":{"url":"https://api.github.com/repos/Netflix/eureka/pulls/644","id":45363704,"html_url":"https://github.com/Netflix/eureka/pull/644","diff_url":"https://github.com/Netflix/eureka/pull/644.diff","patch_url":"https://github.com/Netflix/eureka/pull/644.patch","issue_url":"https://api.github.com/repos/Netflix/eureka/issues/644","number":644,"state":"open","locked":false,"title":"Feature/DI friendly server","user":{"login":"qiangdavidliu","id":6243760,"avatar_url":"https://avatars.githubusercontent.com/u/6243760?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangdavidliu","html_url":"https://github.com/qiangdavidliu","followers_url":"https://api.github.com/users/qiangdavidliu/followers","following_url":"https://api.github.com/users/qiangdavidliu/following{/other_user}","gists_url":"https://api.github.com/users/qiangdavidliu/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangdavidliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangdavidliu/subscriptions","organizations_url":"https://api.github.com/users/qiangdavidliu/orgs","repos_url":"https://api.github.com/users/qiangdavidliu/repos","events_url":"https://api.github.com/users/qiangdavidliu/events{/privacy}","received_events_url":"https://api.github.com/users/qiangdavidliu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-18T02:38:42Z","updated_at":"2015-09-18T21:21:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12910cdcb1ad62582b354b8d773f1ffa5d02ad89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Netflix/eureka/pulls/644/commits","review_comments_url":"https://api.github.com/repos/Netflix/eureka/pulls/644/comments","review_comment_url":"https://api.github.com/repos/Netflix/eureka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Netflix/eureka/issues/644/comments","statuses_url":"https://api.github.com/repos/Netflix/eureka/statuses/efdab4b7266dee0c63cc906fc6c5a762c7992b16","head":{"label":"qiangdavidliu:feature/di-friendly-server","ref":"feature/di-friendly-server","sha":"efdab4b7266dee0c63cc906fc6c5a762c7992b16","user":{"login":"qiangdavidliu","id":6243760,"avatar_url":"https://avatars.githubusercontent.com/u/6243760?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangdavidliu","html_url":"https://github.com/qiangdavidliu","followers_url":"https://api.github.com/users/qiangdavidliu/followers","following_url":"https://api.github.com/users/qiangdavidliu/following{/other_user}","gists_url":"https://api.github.com/users/qiangdavidliu/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangdavidliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangdavidliu/subscriptions","organizations_url":"https://api.github.com/users/qiangdavidliu/orgs","repos_url":"https://api.github.com/users/qiangdavidliu/repos","events_url":"https://api.github.com/users/qiangdavidliu/events{/privacy}","received_events_url":"https://api.github.com/users/qiangdavidliu/received_events","type":"User","site_admin":false},"repo":{"id":23604941,"name":"eureka","full_name":"qiangdavidliu/eureka","owner":{"login":"qiangdavidliu","id":6243760,"avatar_url":"https://avatars.githubusercontent.com/u/6243760?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangdavidliu","html_url":"https://github.com/qiangdavidliu","followers_url":"https://api.github.com/users/qiangdavidliu/followers","following_url":"https://api.github.com/users/qiangdavidliu/following{/other_user}","gists_url":"https://api.github.com/users/qiangdavidliu/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangdavidliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangdavidliu/subscriptions","organizations_url":"https://api.github.com/users/qiangdavidliu/orgs","repos_url":"https://api.github.com/users/qiangdavidliu/repos","events_url":"https://api.github.com/users/qiangdavidliu/events{/privacy}","received_events_url":"https://api.github.com/users/qiangdavidliu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qiangdavidliu/eureka","description":"AWS Service registry for resilient mid-tier load balancing and failover.","fork":true,"url":"https://api.github.com/repos/qiangdavidliu/eureka","forks_url":"https://api.github.com/repos/qiangdavidliu/eureka/forks","keys_url":"https://api.github.com/repos/qiangdavidliu/eureka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qiangdavidliu/eureka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qiangdavidliu/eureka/teams","hooks_url":"https://api.github.com/repos/qiangdavidliu/eureka/hooks","issue_events_url":"https://api.github.com/repos/qiangdavidliu/eureka/issues/events{/number}","events_url":"https://api.github.com/repos/qiangdavidliu/eureka/events","assignees_url":"https://api.github.com/repos/qiangdavidliu/eureka/assignees{/user}","branches_url":"https://api.github.com/repos/qiangdavidliu/eureka/branches{/branch}","tags_url":"https://api.github.com/repos/qiangdavidliu/eureka/tags","blobs_url":"https://api.github.com/repos/qiangdavidliu/eureka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qiangdavidliu/eureka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qiangdavidliu/eureka/git/refs{/sha}","trees_url":"https://api.github.com/repos/qiangdavidliu/eureka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qiangdavidliu/eureka/statuses/{sha}","languages_url":"https://api.github.com/repos/qiangdavidliu/eureka/languages","stargazers_url":"https://api.github.com/repos/qiangdavidliu/eureka/stargazers","contributors_url":"https://api.github.com/repos/qiangdavidliu/eureka/contributors","subscribers_url":"https://api.github.com/repos/qiangdavidliu/eureka/subscribers","subscription_url":"https://api.github.com/repos/qiangdavidliu/eureka/subscription","commits_url":"https://api.github.com/repos/qiangdavidliu/eureka/commits{/sha}","git_commits_url":"https://api.github.com/repos/qiangdavidliu/eureka/git/commits{/sha}","comments_url":"https://api.github.com/repos/qiangdavidliu/eureka/comments{/number}","issue_comment_url":"https://api.github.com/repos/qiangdavidliu/eureka/issues/comments{/number}","contents_url":"https://api.github.com/repos/qiangdavidliu/eureka/contents/{+path}","compare_url":"https://api.github.com/repos/qiangdavidliu/eureka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qiangdavidliu/eureka/merges","archive_url":"https://api.github.com/repos/qiangdavidliu/eureka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qiangdavidliu/eureka/downloads","issues_url":"https://api.github.com/repos/qiangdavidliu/eureka/issues{/number}","pulls_url":"https://api.github.com/repos/qiangdavidliu/eureka/pulls{/number}","milestones_url":"https://api.github.com/repos/qiangdavidliu/eureka/milestones{/number}","notifications_url":"https://api.github.com/repos/qiangdavidliu/eureka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qiangdavidliu/eureka/labels{/name}","releases_url":"https://api.github.com/repos/qiangdavidliu/eureka/releases{/id}","created_at":"2014-09-03T03:18:30Z","updated_at":"2015-03-27T18:57:25Z","pushed_at":"2015-09-18T02:38:29Z","git_url":"git://github.com/qiangdavidliu/eureka.git","ssh_url":"git@github.com:qiangdavidliu/eureka.git","clone_url":"https://github.com/qiangdavidliu/eureka.git","svn_url":"https://github.com/qiangdavidliu/eureka","homepage":"","size":10004,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Netflix:master","ref":"master","sha":"e879aa1e6a2f0de180e530ec74883c11f6e16650","user":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"repo":{"id":5198041,"name":"eureka","full_name":"Netflix/eureka","owner":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Netflix/eureka","description":"AWS Service registry for resilient mid-tier load balancing and failover.","fork":false,"url":"https://api.github.com/repos/Netflix/eureka","forks_url":"https://api.github.com/repos/Netflix/eureka/forks","keys_url":"https://api.github.com/repos/Netflix/eureka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Netflix/eureka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Netflix/eureka/teams","hooks_url":"https://api.github.com/repos/Netflix/eureka/hooks","issue_events_url":"https://api.github.com/repos/Netflix/eureka/issues/events{/number}","events_url":"https://api.github.com/repos/Netflix/eureka/events","assignees_url":"https://api.github.com/repos/Netflix/eureka/assignees{/user}","branches_url":"https://api.github.com/repos/Netflix/eureka/branches{/branch}","tags_url":"https://api.github.com/repos/Netflix/eureka/tags","blobs_url":"https://api.github.com/repos/Netflix/eureka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Netflix/eureka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Netflix/eureka/git/refs{/sha}","trees_url":"https://api.github.com/repos/Netflix/eureka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Netflix/eureka/statuses/{sha}","languages_url":"https://api.github.com/repos/Netflix/eureka/languages","stargazers_url":"https://api.github.com/repos/Netflix/eureka/stargazers","contributors_url":"https://api.github.com/repos/Netflix/eureka/contributors","subscribers_url":"https://api.github.com/repos/Netflix/eureka/subscribers","subscription_url":"https://api.github.com/repos/Netflix/eureka/subscription","commits_url":"https://api.github.com/repos/Netflix/eureka/commits{/sha}","git_commits_url":"https://api.github.com/repos/Netflix/eureka/git/commits{/sha}","comments_url":"https://api.github.com/repos/Netflix/eureka/comments{/number}","issue_comment_url":"https://api.github.com/repos/Netflix/eureka/issues/comments{/number}","contents_url":"https://api.github.com/repos/Netflix/eureka/contents/{+path}","compare_url":"https://api.github.com/repos/Netflix/eureka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Netflix/eureka/merges","archive_url":"https://api.github.com/repos/Netflix/eureka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Netflix/eureka/downloads","issues_url":"https://api.github.com/repos/Netflix/eureka/issues{/number}","pulls_url":"https://api.github.com/repos/Netflix/eureka/pulls{/number}","milestones_url":"https://api.github.com/repos/Netflix/eureka/milestones{/number}","notifications_url":"https://api.github.com/repos/Netflix/eureka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Netflix/eureka/labels{/name}","releases_url":"https://api.github.com/repos/Netflix/eureka/releases{/id}","created_at":"2012-07-26T22:23:07Z","updated_at":"2015-09-18T16:30:37Z","pushed_at":"2015-09-18T02:38:43Z","git_url":"git://github.com/Netflix/eureka.git","ssh_url":"git@github.com:Netflix/eureka.git","clone_url":"https://github.com/Netflix/eureka.git","svn_url":"https://github.com/Netflix/eureka","homepage":"","size":16052,"stargazers_count":1211,"watchers_count":1211,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":280,"mirror_url":null,"open_issues_count":36,"forks":280,"open_issues":36,"watchers":1211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/644"},"html":{"href":"https://github.com/Netflix/eureka/pull/644"},"issue":{"href":"https://api.github.com/repos/Netflix/eureka/issues/644"},"comments":{"href":"https://api.github.com/repos/Netflix/eureka/issues/644/comments"},"review_comments":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/644/comments"},"review_comment":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Netflix/eureka/pulls/644/commits"},"statuses":{"href":"https://api.github.com/repos/Netflix/eureka/statuses/efdab4b7266dee0c63cc906fc6c5a762c7992b16"}}}}