{"action":"created","comment":{"url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/comments/157455642","pull_request_review_id":84098657,"id":157455642,"diff_hunk":"@@ -54,13 +58,31 @@ public void createService(CloudFoundryOperations client, CloudServiceExtended se\n     }\n \n     private List<String> computeValidServiceOfferings(CloudFoundryOperations client, List<String> possibleServiceOfferings,\n-        List<String> existingServiceOfferings) {\n+        String servicePlan, Map<String, List<CloudServicePlan>> existingServiceOfferings) {\n         List<String> validServiceOfferings = new ArrayList<String>();\n         for (String possibleServiceOffering : possibleServiceOfferings) {\n-            if (existingServiceOfferings.contains(possibleServiceOffering)) {\n+            for (String existingServiceOffering : existingServiceOfferings.keySet()) {\n+                if (!existingServiceOffering.equals(possibleServiceOffering)) {\n+                    LOGGER.warn(format(\"Defined service offering \\\"{0}\\\" is not existing\", possibleServiceOffering));\n+                    continue;\n+                }\n+                CloudServicePlan existingCloudServicePlan = existingServiceOfferings.get(existingServiceOffering)\n+                    .stream()\n+                    .filter(cloudServicePlan -> servicePlan.equals(cloudServicePlan.getName()))\n+                    .findAny()\n+                    .orElse(null);\n+                if (existingCloudServicePlan == null) {\n+                    LOGGER.warn(format(\"Defined service offering \\\"{0}\\\" does not provide service plan \\\"{1}\\\"\", possibleServiceOffering, servicePlan));\n+                    continue;\n+                }\n                 validServiceOfferings.add(possibleServiceOffering);\n-            } else {\n-                LOGGER.warn(format(\"Defined service offering \\\"{0}\\\" is not existing\", possibleServiceOffering));\n+                // List<String> existingServicePlans = existingServiceOfferings.get(existingServiceOffering).stream().map(cloudServicePlan","path":"com.sap.cloud.lm.sl.cf.core/src/main/java/com/sap/cloud/lm/sl/cf/core/cf/clients/ServiceCreator.java","position":57,"original_position":57,"commit_id":"e267e6a41814b22ed4629d83a005afbeb5bce96c","original_commit_id":"e267e6a41814b22ed4629d83a005afbeb5bce96c","user":{"login":"boyan-velinov","id":32568491,"avatar_url":"https://avatars1.githubusercontent.com/u/32568491?v=4","gravatar_id":"","url":"https://api.github.com/users/boyan-velinov","html_url":"https://github.com/boyan-velinov","followers_url":"https://api.github.com/users/boyan-velinov/followers","following_url":"https://api.github.com/users/boyan-velinov/following{/other_user}","gists_url":"https://api.github.com/users/boyan-velinov/gists{/gist_id}","starred_url":"https://api.github.com/users/boyan-velinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyan-velinov/subscriptions","organizations_url":"https://api.github.com/users/boyan-velinov/orgs","repos_url":"https://api.github.com/users/boyan-velinov/repos","events_url":"https://api.github.com/users/boyan-velinov/events{/privacy}","received_events_url":"https://api.github.com/users/boyan-velinov/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2017-12-18T11:06:24Z","updated_at":"2017-12-18T11:06:24Z","html_url":"https://github.com/SAP/cf-mta-deploy-service/pull/67#discussion_r157455642","pull_request_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/comments/157455642"},"html":{"href":"https://github.com/SAP/cf-mta-deploy-service/pull/67#discussion_r157455642"},"pull_request":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67"}},"in_reply_to_id":157436130},"pull_request":{"url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67","id":158643386,"html_url":"https://github.com/SAP/cf-mta-deploy-service/pull/67","diff_url":"https://github.com/SAP/cf-mta-deploy-service/pull/67.diff","patch_url":"https://github.com/SAP/cf-mta-deploy-service/pull/67.patch","issue_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/67","number":67,"state":"open","locked":false,"title":"Use service alternative if plan does not exist","user":{"login":"boyan-velinov","id":32568491,"avatar_url":"https://avatars1.githubusercontent.com/u/32568491?v=4","gravatar_id":"","url":"https://api.github.com/users/boyan-velinov","html_url":"https://github.com/boyan-velinov","followers_url":"https://api.github.com/users/boyan-velinov/followers","following_url":"https://api.github.com/users/boyan-velinov/following{/other_user}","gists_url":"https://api.github.com/users/boyan-velinov/gists{/gist_id}","starred_url":"https://api.github.com/users/boyan-velinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyan-velinov/subscriptions","organizations_url":"https://api.github.com/users/boyan-velinov/orgs","repos_url":"https://api.github.com/users/boyan-velinov/repos","events_url":"https://api.github.com/users/boyan-velinov/events{/privacy}","received_events_url":"https://api.github.com/users/boyan-velinov/received_events","type":"User","site_admin":false},"body":"Jira: LMCROSSITXSADEPLOY-709","created_at":"2017-12-15T16:34:08Z","updated_at":"2017-12-18T11:06:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"029010ee3aeb3f21c7b30440034d4795ed43ba67","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67/commits","review_comments_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67/comments","review_comment_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/67/comments","statuses_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/statuses/e267e6a41814b22ed4629d83a005afbeb5bce96c","head":{"label":"boyan-velinov:serviceAlternative","ref":"serviceAlternative","sha":"e267e6a41814b22ed4629d83a005afbeb5bce96c","user":{"login":"boyan-velinov","id":32568491,"avatar_url":"https://avatars1.githubusercontent.com/u/32568491?v=4","gravatar_id":"","url":"https://api.github.com/users/boyan-velinov","html_url":"https://github.com/boyan-velinov","followers_url":"https://api.github.com/users/boyan-velinov/followers","following_url":"https://api.github.com/users/boyan-velinov/following{/other_user}","gists_url":"https://api.github.com/users/boyan-velinov/gists{/gist_id}","starred_url":"https://api.github.com/users/boyan-velinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyan-velinov/subscriptions","organizations_url":"https://api.github.com/users/boyan-velinov/orgs","repos_url":"https://api.github.com/users/boyan-velinov/repos","events_url":"https://api.github.com/users/boyan-velinov/events{/privacy}","received_events_url":"https://api.github.com/users/boyan-velinov/received_events","type":"User","site_admin":false},"repo":{"id":106520521,"name":"cf-mta-deploy-service","full_name":"boyan-velinov/cf-mta-deploy-service","owner":{"login":"boyan-velinov","id":32568491,"avatar_url":"https://avatars1.githubusercontent.com/u/32568491?v=4","gravatar_id":"","url":"https://api.github.com/users/boyan-velinov","html_url":"https://github.com/boyan-velinov","followers_url":"https://api.github.com/users/boyan-velinov/followers","following_url":"https://api.github.com/users/boyan-velinov/following{/other_user}","gists_url":"https://api.github.com/users/boyan-velinov/gists{/gist_id}","starred_url":"https://api.github.com/users/boyan-velinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyan-velinov/subscriptions","organizations_url":"https://api.github.com/users/boyan-velinov/orgs","repos_url":"https://api.github.com/users/boyan-velinov/repos","events_url":"https://api.github.com/users/boyan-velinov/events{/privacy}","received_events_url":"https://api.github.com/users/boyan-velinov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/boyan-velinov/cf-mta-deploy-service","description":"Multi-Target Application (MTA) deployment service for Cloud Foundry ","fork":true,"url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service","forks_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/forks","keys_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/teams","hooks_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/hooks","issue_events_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/issues/events{/number}","events_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/events","assignees_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/assignees{/user}","branches_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/branches{/branch}","tags_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/tags","blobs_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/statuses/{sha}","languages_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/languages","stargazers_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/stargazers","contributors_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/contributors","subscribers_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/subscribers","subscription_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/subscription","commits_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/contents/{+path}","compare_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/merges","archive_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/downloads","issues_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/issues{/number}","pulls_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/pulls{/number}","milestones_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/milestones{/number}","notifications_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/labels{/name}","releases_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/releases{/id}","deployments_url":"https://api.github.com/repos/boyan-velinov/cf-mta-deploy-service/deployments","created_at":"2017-10-11T07:30:07Z","updated_at":"2017-10-11T07:30:10Z","pushed_at":"2017-12-15T16:33:21Z","git_url":"git://github.com/boyan-velinov/cf-mta-deploy-service.git","ssh_url":"git@github.com:boyan-velinov/cf-mta-deploy-service.git","clone_url":"https://github.com/boyan-velinov/cf-mta-deploy-service.git","svn_url":"https://github.com/boyan-velinov/cf-mta-deploy-service","homepage":"","size":1384,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SAP:master","ref":"master","sha":"3538fb3bd584f4b77905b30914ebb07a65c31873","user":{"login":"SAP","id":2531208,"avatar_url":"https://avatars1.githubusercontent.com/u/2531208?v=4","gravatar_id":"","url":"https://api.github.com/users/SAP","html_url":"https://github.com/SAP","followers_url":"https://api.github.com/users/SAP/followers","following_url":"https://api.github.com/users/SAP/following{/other_user}","gists_url":"https://api.github.com/users/SAP/gists{/gist_id}","starred_url":"https://api.github.com/users/SAP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SAP/subscriptions","organizations_url":"https://api.github.com/users/SAP/orgs","repos_url":"https://api.github.com/users/SAP/repos","events_url":"https://api.github.com/users/SAP/events{/privacy}","received_events_url":"https://api.github.com/users/SAP/received_events","type":"Organization","site_admin":false},"repo":{"id":105860042,"name":"cf-mta-deploy-service","full_name":"SAP/cf-mta-deploy-service","owner":{"login":"SAP","id":2531208,"avatar_url":"https://avatars1.githubusercontent.com/u/2531208?v=4","gravatar_id":"","url":"https://api.github.com/users/SAP","html_url":"https://github.com/SAP","followers_url":"https://api.github.com/users/SAP/followers","following_url":"https://api.github.com/users/SAP/following{/other_user}","gists_url":"https://api.github.com/users/SAP/gists{/gist_id}","starred_url":"https://api.github.com/users/SAP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SAP/subscriptions","organizations_url":"https://api.github.com/users/SAP/orgs","repos_url":"https://api.github.com/users/SAP/repos","events_url":"https://api.github.com/users/SAP/events{/privacy}","received_events_url":"https://api.github.com/users/SAP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SAP/cf-mta-deploy-service","description":"Multi-Target Application (MTA) deployment service for Cloud Foundry ","fork":false,"url":"https://api.github.com/repos/SAP/cf-mta-deploy-service","forks_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/forks","keys_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/teams","hooks_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/hooks","issue_events_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/events{/number}","events_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/events","assignees_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/assignees{/user}","branches_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/branches{/branch}","tags_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/tags","blobs_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/statuses/{sha}","languages_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/languages","stargazers_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/stargazers","contributors_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/contributors","subscribers_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/subscribers","subscription_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/subscription","commits_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/contents/{+path}","compare_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/merges","archive_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/downloads","issues_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues{/number}","pulls_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls{/number}","milestones_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/milestones{/number}","notifications_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/labels{/name}","releases_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/releases{/id}","deployments_url":"https://api.github.com/repos/SAP/cf-mta-deploy-service/deployments","created_at":"2017-10-05T07:14:47Z","updated_at":"2017-12-16T13:51:14Z","pushed_at":"2017-12-16T12:49:41Z","git_url":"git://github.com/SAP/cf-mta-deploy-service.git","ssh_url":"git@github.com:SAP/cf-mta-deploy-service.git","clone_url":"https://github.com/SAP/cf-mta-deploy-service.git","svn_url":"https://github.com/SAP/cf-mta-deploy-service","homepage":"","size":1381,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67"},"html":{"href":"https://github.com/SAP/cf-mta-deploy-service/pull/67"},"issue":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/67"},"comments":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/SAP/cf-mta-deploy-service/statuses/e267e6a41814b22ed4629d83a005afbeb5bce96c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"boyan-velinov"}}