{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/48943281","id":48943281,"diff_hunk":"@@ -0,0 +1,77 @@\n+package com.hazelcast.partition.impl;\n+\n+import com.hazelcast.test.annotation.QuickTest;\n+import org.junit.Test;\n+import org.junit.experimental.categories.Category;\n+\n+import java.util.concurrent.TimeUnit;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertTrue;\n+import static org.mockito.Mockito.mock;\n+\n+@Category(QuickTest.class)\n+public class MigrationQueueTest {\n+\n+    private final MigrationQueue migrationQueue = new MigrationQueue();\n+\n+    @Test\n+    public void test_migrationTaskCount_incremented_onMigrateTask() {\n+        migrationQueue.add(mock(InternalPartitionServiceImpl.MigrateTask.class));\n+\n+        assertTrue(migrationQueue.hasMigrations());\n+        assertEquals(1, migrationQueue.size());\n+    }\n+\n+    @Test\n+    public void test_migrationTaskCount_notIncremented_onNonMigrateTask() {\n+        migrationQueue.add(mock(Runnable.class));\n+\n+        assertFalse(migrationQueue.hasMigrations());\n+        assertEquals(1, migrationQueue.size());\n+    }\n+\n+    @Test\n+    public void test_migrationTaskCount_notDecremented_afterMigrateTaskPolled()\n+            throws InterruptedException {\n+        migrationQueue.add(mock(InternalPartitionServiceImpl.MigrateTask.class));\n+        migrationQueue.poll(1, TimeUnit.SECONDS);\n+\n+        assertTrue(migrationQueue.hasMigrations());\n+    }\n+\n+    @Test\n+    public void test_migrateTaskCount_decremented_afterMigrateTaskCompleted()\n+            throws InterruptedException {\n+        final InternalPartitionServiceImpl.MigrateTask migrateTask = mock(InternalPartitionServiceImpl.MigrateTask.class);","path":"hazelcast/src/test/java/com/hazelcast/partition/impl/MigrationQueueTest.java","position":47,"original_position":47,"commit_id":"263b456d2dad40e4aa32c5ee67c431ee8022ab9b","original_commit_id":"263b456d2dad40e4aa32c5ee67c431ee8022ab9b","user":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=3","gravatar_id":"","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"body":"Can you make this a static import?","created_at":"2016-01-06T10:15:55Z","updated_at":"2016-01-06T10:15:55Z","html_url":"https://github.com/hazelcast/hazelcast/pull/7218#discussion_r48943281","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/48943281"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/7218#discussion_r48943281"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218","id":54856138,"html_url":"https://github.com/hazelcast/hazelcast/pull/7218","diff_url":"https://github.com/hazelcast/hazelcast/pull/7218.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/7218.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/7218","number":7218,"state":"open","locked":false,"title":"Extract migration queue from InternalPartitionServiceImpl","user":{"login":"metanet","id":999867,"avatar_url":"https://avatars.githubusercontent.com/u/999867?v=3","gravatar_id":"","url":"https://api.github.com/users/metanet","html_url":"https://github.com/metanet","followers_url":"https://api.github.com/users/metanet/followers","following_url":"https://api.github.com/users/metanet/following{/other_user}","gists_url":"https://api.github.com/users/metanet/gists{/gist_id}","starred_url":"https://api.github.com/users/metanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metanet/subscriptions","organizations_url":"https://api.github.com/users/metanet/orgs","repos_url":"https://api.github.com/users/metanet/repos","events_url":"https://api.github.com/users/metanet/events{/privacy}","received_events_url":"https://api.github.com/users/metanet/received_events","type":"User","site_admin":false},"body":"Fixes #7191 ","created_at":"2015-12-31T09:51:09Z","updated_at":"2016-01-06T10:15:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c119c92da60752f06ab03619655d82d62f7cae0c","assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":1204,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2016-01-06T09:42:04Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/7218/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/263b456d2dad40e4aa32c5ee67c431ee8022ab9b","head":{"label":"metanet:fix/master/7191","ref":"fix/master/7191","sha":"263b456d2dad40e4aa32c5ee67c431ee8022ab9b","user":{"login":"metanet","id":999867,"avatar_url":"https://avatars.githubusercontent.com/u/999867?v=3","gravatar_id":"","url":"https://api.github.com/users/metanet","html_url":"https://github.com/metanet","followers_url":"https://api.github.com/users/metanet/followers","following_url":"https://api.github.com/users/metanet/following{/other_user}","gists_url":"https://api.github.com/users/metanet/gists{/gist_id}","starred_url":"https://api.github.com/users/metanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metanet/subscriptions","organizations_url":"https://api.github.com/users/metanet/orgs","repos_url":"https://api.github.com/users/metanet/repos","events_url":"https://api.github.com/users/metanet/events{/privacy}","received_events_url":"https://api.github.com/users/metanet/received_events","type":"User","site_admin":false},"repo":{"id":30364098,"name":"hazelcast","full_name":"metanet/hazelcast","owner":{"login":"metanet","id":999867,"avatar_url":"https://avatars.githubusercontent.com/u/999867?v=3","gravatar_id":"","url":"https://api.github.com/users/metanet","html_url":"https://github.com/metanet","followers_url":"https://api.github.com/users/metanet/followers","following_url":"https://api.github.com/users/metanet/following{/other_user}","gists_url":"https://api.github.com/users/metanet/gists{/gist_id}","starred_url":"https://api.github.com/users/metanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metanet/subscriptions","organizations_url":"https://api.github.com/users/metanet/orgs","repos_url":"https://api.github.com/users/metanet/repos","events_url":"https://api.github.com/users/metanet/events{/privacy}","received_events_url":"https://api.github.com/users/metanet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/metanet/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/metanet/hazelcast","forks_url":"https://api.github.com/repos/metanet/hazelcast/forks","keys_url":"https://api.github.com/repos/metanet/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metanet/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metanet/hazelcast/teams","hooks_url":"https://api.github.com/repos/metanet/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/metanet/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/metanet/hazelcast/events","assignees_url":"https://api.github.com/repos/metanet/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/metanet/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/metanet/hazelcast/tags","blobs_url":"https://api.github.com/repos/metanet/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metanet/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metanet/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/metanet/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metanet/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/metanet/hazelcast/languages","stargazers_url":"https://api.github.com/repos/metanet/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/metanet/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/metanet/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/metanet/hazelcast/subscription","commits_url":"https://api.github.com/repos/metanet/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/metanet/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/metanet/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/metanet/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/metanet/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/metanet/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metanet/hazelcast/merges","archive_url":"https://api.github.com/repos/metanet/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metanet/hazelcast/downloads","issues_url":"https://api.github.com/repos/metanet/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/metanet/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/metanet/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/metanet/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metanet/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/metanet/hazelcast/releases{/id}","created_at":"2015-02-05T15:59:10Z","updated_at":"2015-02-26T15:48:33Z","pushed_at":"2016-01-06T10:04:25Z","git_url":"git://github.com/metanet/hazelcast.git","ssh_url":"git@github.com:metanet/hazelcast.git","clone_url":"https://github.com/metanet/hazelcast.git","svn_url":"https://github.com/metanet/hazelcast","homepage":"www.hazelcast.com","size":83185,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hazelcast:master","ref":"master","sha":"256cbfff794f6432fb93c8d0f4511db7fe2d5a74","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","created_at":"2012-03-21T12:25:18Z","updated_at":"2016-01-06T08:40:20Z","pushed_at":"2016-01-06T10:04:26Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":95181,"stargazers_count":1362,"watchers_count":1362,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":670,"mirror_url":null,"open_issues_count":493,"forks":670,"open_issues":493,"watchers":1362,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/7218"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/7218"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/7218/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/7218/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/263b456d2dad40e4aa32c5ee67c431ee8022ab9b"}}}}