{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/hawkbit/pulls/comments/82836094","pull_request_review_id":3715165,"id":82836094,"diff_hunk":"@@ -0,0 +1,123 @@\n+/**\n+ * Copyright (c) 2015 Bosch Software Innovations GmbH and others.\n+ *\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.eclipse.hawkbit.repository.jpa.rsql;\n+\n+import static org.junit.Assert.*;\n+import static org.mockito.Mockito.spy;\n+import static org.mockito.Mockito.when;\n+\n+import java.time.Instant;\n+\n+import org.apache.commons.lang3.text.StrSubstitutor;\n+import org.eclipse.hawkbit.repository.TenantConfigurationManagement;\n+import org.eclipse.hawkbit.repository.jpa.TimestampCalculator;\n+import org.eclipse.hawkbit.repository.model.TenantConfigurationValue;\n+import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.Mock;\n+import org.mockito.Spy;\n+import org.mockito.runners.MockitoJUnitRunner;\n+\n+import ru.yandex.qatools.allure.annotations.Description;\n+import ru.yandex.qatools.allure.annotations.Features;\n+import ru.yandex.qatools.allure.annotations.Stories;\n+\n+@Features(\"Unit Tests - Repository\")\n+@Stories(\"Placeholder resolution for virtual properties\")\n+@RunWith(MockitoJUnitRunner.class)\n+public class VirtualPropertyResolverTest {\n+\n+    @Spy\n+    VirtualPropertyResolver resolverUnderTest = new VirtualPropertyResolver(new TimestampCalculator());\n+\n+    @Mock\n+    TenantConfigurationManagement confMgmt;\n+\n+    StrSubstitutor substitutor;\n+\n+    Long nowTestTime;\n+\n+    private static final TenantConfigurationValue<String> TEST_POLLING_TIME_INTERVAL = TenantConfigurationValue\n+            .<String> builder().value(\"00:05:00\").build();\n+    private static final TenantConfigurationValue<String> TEST_POLLING_OVERDUE_TIME_INTERVAL = TenantConfigurationValue\n+            .<String> builder().value(\"00:07:37\").build();\n+\n+    @Before\n+    public void before() {\n+        nowTestTime = Instant.now().toEpochMilli();\n+        when(confMgmt.getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class))\n+            .thenReturn(TEST_POLLING_TIME_INTERVAL);\n+        when(confMgmt.getConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class))\n+            .thenReturn(TEST_POLLING_OVERDUE_TIME_INTERVAL);\n+\n+        when(resolverUnderTest.getTimestampCalculator()).thenReturn(new TimestampCalculator() {\n+            @Override\n+            protected TenantConfigurationManagement getTenantConfigurationManagement() {\n+                return confMgmt;\n+            }\n+        });\n+\n+        this.substitutor = new StrSubstitutor(resolverUnderTest,","path":"hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolverTest.java","position":68,"original_position":68,"commit_id":"4785f36b34a5dac3795addd9a878610c4a19bd1b","original_commit_id":"4785f36b34a5dac3795addd9a878610c4a19bd1b","user":{"login":"schabdo","id":18215905,"avatar_url":"https://avatars.githubusercontent.com/u/18215905?v=3","gravatar_id":"","url":"https://api.github.com/users/schabdo","html_url":"https://github.com/schabdo","followers_url":"https://api.github.com/users/schabdo/followers","following_url":"https://api.github.com/users/schabdo/following{/other_user}","gists_url":"https://api.github.com/users/schabdo/gists{/gist_id}","starred_url":"https://api.github.com/users/schabdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schabdo/subscriptions","organizations_url":"https://api.github.com/users/schabdo/orgs","repos_url":"https://api.github.com/users/schabdo/repos","events_url":"https://api.github.com/users/schabdo/events{/privacy}","received_events_url":"https://api.github.com/users/schabdo/received_events","type":"User","site_admin":false},"body":"`this` is not required here, remove it","created_at":"2016-10-11T16:42:18Z","updated_at":"2016-10-11T16:42:18Z","html_url":"https://github.com/eclipse/hawkbit/pull/298#discussion_r82836094","pull_request_url":"https://api.github.com/repos/eclipse/hawkbit/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/comments/82836094"},"html":{"href":"https://github.com/eclipse/hawkbit/pull/298#discussion_r82836094"},"pull_request":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/hawkbit/pulls/298","id":86336669,"html_url":"https://github.com/eclipse/hawkbit/pull/298","diff_url":"https://github.com/eclipse/hawkbit/pull/298.diff","patch_url":"https://github.com/eclipse/hawkbit/pull/298.patch","issue_url":"https://api.github.com/repos/eclipse/hawkbit/issues/298","number":298,"state":"open","locked":false,"title":"Feature target filtering supports overdue","user":{"login":"MarcelMager","id":21199311,"avatar_url":"https://avatars.githubusercontent.com/u/21199311?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcelMager","html_url":"https://github.com/MarcelMager","followers_url":"https://api.github.com/users/MarcelMager/followers","following_url":"https://api.github.com/users/MarcelMager/following{/other_user}","gists_url":"https://api.github.com/users/MarcelMager/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcelMager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcelMager/subscriptions","organizations_url":"https://api.github.com/users/MarcelMager/orgs","repos_url":"https://api.github.com/users/MarcelMager/repos","events_url":"https://api.github.com/users/MarcelMager/events{/privacy}","received_events_url":"https://api.github.com/users/MarcelMager/received_events","type":"User","site_admin":false},"body":"The Filter mechanism is extended to support filtering for overdued devices; therefore some macro-mechanism has been introduced to resolve such kind of virtual properties.\r\n\r\nKnown virtual properties (maybe extended in the future):\r\n1. ${now_ts}\r\n2. ${overdue_ts}\r\n\r\nAn example RSQL filter to filter for overdued targets would be:\r\n`lastcontrollerrequestat=le=${overdue_ts}`\r\n\r\nThe UI was extended accordingly to support the overdue filter as Simple Filter as checkbox (similar to the target states).","created_at":"2016-09-22T13:25:46Z","updated_at":"2016-10-11T16:42:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f62f80c41c462e97ded6211906cd116c538f1e1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/hawkbit/pulls/298/commits","review_comments_url":"https://api.github.com/repos/eclipse/hawkbit/pulls/298/comments","review_comment_url":"https://api.github.com/repos/eclipse/hawkbit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/hawkbit/issues/298/comments","statuses_url":"https://api.github.com/repos/eclipse/hawkbit/statuses/4785f36b34a5dac3795addd9a878610c4a19bd1b","head":{"label":"bsinno:feature_target_filtering_supports_overdue","ref":"feature_target_filtering_supports_overdue","sha":"4785f36b34a5dac3795addd9a878610c4a19bd1b","user":{"login":"bsinno","id":9215699,"avatar_url":"https://avatars.githubusercontent.com/u/9215699?v=3","gravatar_id":"","url":"https://api.github.com/users/bsinno","html_url":"https://github.com/bsinno","followers_url":"https://api.github.com/users/bsinno/followers","following_url":"https://api.github.com/users/bsinno/following{/other_user}","gists_url":"https://api.github.com/users/bsinno/gists{/gist_id}","starred_url":"https://api.github.com/users/bsinno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsinno/subscriptions","organizations_url":"https://api.github.com/users/bsinno/orgs","repos_url":"https://api.github.com/users/bsinno/repos","events_url":"https://api.github.com/users/bsinno/events{/privacy}","received_events_url":"https://api.github.com/users/bsinno/received_events","type":"Organization","site_admin":false},"repo":{"id":50108079,"name":"hawkbit","full_name":"bsinno/hawkbit","owner":{"login":"bsinno","id":9215699,"avatar_url":"https://avatars.githubusercontent.com/u/9215699?v=3","gravatar_id":"","url":"https://api.github.com/users/bsinno","html_url":"https://github.com/bsinno","followers_url":"https://api.github.com/users/bsinno/followers","following_url":"https://api.github.com/users/bsinno/following{/other_user}","gists_url":"https://api.github.com/users/bsinno/gists{/gist_id}","starred_url":"https://api.github.com/users/bsinno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsinno/subscriptions","organizations_url":"https://api.github.com/users/bsinno/orgs","repos_url":"https://api.github.com/users/bsinno/repos","events_url":"https://api.github.com/users/bsinno/events{/privacy}","received_events_url":"https://api.github.com/users/bsinno/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bsinno/hawkbit","description":"","fork":true,"url":"https://api.github.com/repos/bsinno/hawkbit","forks_url":"https://api.github.com/repos/bsinno/hawkbit/forks","keys_url":"https://api.github.com/repos/bsinno/hawkbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bsinno/hawkbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bsinno/hawkbit/teams","hooks_url":"https://api.github.com/repos/bsinno/hawkbit/hooks","issue_events_url":"https://api.github.com/repos/bsinno/hawkbit/issues/events{/number}","events_url":"https://api.github.com/repos/bsinno/hawkbit/events","assignees_url":"https://api.github.com/repos/bsinno/hawkbit/assignees{/user}","branches_url":"https://api.github.com/repos/bsinno/hawkbit/branches{/branch}","tags_url":"https://api.github.com/repos/bsinno/hawkbit/tags","blobs_url":"https://api.github.com/repos/bsinno/hawkbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bsinno/hawkbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bsinno/hawkbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/bsinno/hawkbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bsinno/hawkbit/statuses/{sha}","languages_url":"https://api.github.com/repos/bsinno/hawkbit/languages","stargazers_url":"https://api.github.com/repos/bsinno/hawkbit/stargazers","contributors_url":"https://api.github.com/repos/bsinno/hawkbit/contributors","subscribers_url":"https://api.github.com/repos/bsinno/hawkbit/subscribers","subscription_url":"https://api.github.com/repos/bsinno/hawkbit/subscription","commits_url":"https://api.github.com/repos/bsinno/hawkbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/bsinno/hawkbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/bsinno/hawkbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/bsinno/hawkbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/bsinno/hawkbit/contents/{+path}","compare_url":"https://api.github.com/repos/bsinno/hawkbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bsinno/hawkbit/merges","archive_url":"https://api.github.com/repos/bsinno/hawkbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bsinno/hawkbit/downloads","issues_url":"https://api.github.com/repos/bsinno/hawkbit/issues{/number}","pulls_url":"https://api.github.com/repos/bsinno/hawkbit/pulls{/number}","milestones_url":"https://api.github.com/repos/bsinno/hawkbit/milestones{/number}","notifications_url":"https://api.github.com/repos/bsinno/hawkbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bsinno/hawkbit/labels{/name}","releases_url":"https://api.github.com/repos/bsinno/hawkbit/releases{/id}","deployments_url":"https://api.github.com/repos/bsinno/hawkbit/deployments","created_at":"2016-01-21T13:05:15Z","updated_at":"2016-09-27T18:10:56Z","pushed_at":"2016-10-11T14:27:28Z","git_url":"git://github.com/bsinno/hawkbit.git","ssh_url":"git@github.com:bsinno/hawkbit.git","clone_url":"https://github.com/bsinno/hawkbit.git","svn_url":"https://github.com/bsinno/hawkbit","homepage":null,"size":8630,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"eclipse:master","ref":"master","sha":"f4a88488e487d1d9e4e389304ceb78b2eba165bc","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":45860898,"name":"hawkbit","full_name":"eclipse/hawkbit","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/hawkbit","description":"","fork":false,"url":"https://api.github.com/repos/eclipse/hawkbit","forks_url":"https://api.github.com/repos/eclipse/hawkbit/forks","keys_url":"https://api.github.com/repos/eclipse/hawkbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/hawkbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/hawkbit/teams","hooks_url":"https://api.github.com/repos/eclipse/hawkbit/hooks","issue_events_url":"https://api.github.com/repos/eclipse/hawkbit/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/hawkbit/events","assignees_url":"https://api.github.com/repos/eclipse/hawkbit/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/hawkbit/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/hawkbit/tags","blobs_url":"https://api.github.com/repos/eclipse/hawkbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/hawkbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/hawkbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/hawkbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/hawkbit/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/hawkbit/languages","stargazers_url":"https://api.github.com/repos/eclipse/hawkbit/stargazers","contributors_url":"https://api.github.com/repos/eclipse/hawkbit/contributors","subscribers_url":"https://api.github.com/repos/eclipse/hawkbit/subscribers","subscription_url":"https://api.github.com/repos/eclipse/hawkbit/subscription","commits_url":"https://api.github.com/repos/eclipse/hawkbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/hawkbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/hawkbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/hawkbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/hawkbit/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/hawkbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/hawkbit/merges","archive_url":"https://api.github.com/repos/eclipse/hawkbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/hawkbit/downloads","issues_url":"https://api.github.com/repos/eclipse/hawkbit/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/hawkbit/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/hawkbit/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/hawkbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/hawkbit/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/hawkbit/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/hawkbit/deployments","created_at":"2015-11-09T19:19:06Z","updated_at":"2016-10-11T11:16:53Z","pushed_at":"2016-10-11T14:27:32Z","git_url":"git://github.com/eclipse/hawkbit.git","ssh_url":"git@github.com:eclipse/hawkbit.git","clone_url":"https://github.com/eclipse/hawkbit.git","svn_url":"https://github.com/eclipse/hawkbit","homepage":null,"size":9213,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":26,"forks":8,"open_issues":26,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/298"},"html":{"href":"https://github.com/eclipse/hawkbit/pull/298"},"issue":{"href":"https://api.github.com/repos/eclipse/hawkbit/issues/298"},"comments":{"href":"https://api.github.com/repos/eclipse/hawkbit/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/hawkbit/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/hawkbit/statuses/4785f36b34a5dac3795addd9a878610c4a19bd1b"}}}}
{"actor":{"display_login":"schabdo"}}