{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/55066782","id":55066782,"diff_hunk":"@@ -0,0 +1,498 @@\n+/**\n+ * Copyright (c) Codice Foundation\n+ * <p>\n+ * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser\n+ * General Public License as published by the Free Software Foundation, either version 3 of the\n+ * License, or any later version.\n+ * <p>\n+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\n+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ * Lesser General Public License for more details. A copy of the GNU Lesser General Public License\n+ * is distributed along with this program and can be found at\n+ * <http://www.gnu.org/licenses/lgpl.html>.\n+ */\n+package ddf.content.plugin.cataloger;\n+\n+import static org.junit.Assert.assertArrayEquals;\n+import static org.junit.Assert.assertNotNull;\n+import static org.junit.Assert.assertTrue;\n+import static org.mockito.Matchers.any;\n+import static org.mockito.Matchers.eq;\n+import static org.mockito.Matchers.isNull;\n+import static org.mockito.Mockito.mock;\n+import static org.mockito.Mockito.when;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.io.Serializable;\n+import java.net.URI;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.UUID;\n+\n+import javax.activation.MimeType;\n+\n+import org.apache.shiro.mgt.DefaultSecurityManager;\n+import org.apache.shiro.session.mgt.SimpleSession;\n+import org.apache.shiro.subject.PrincipalCollection;\n+import org.apache.shiro.subject.SimplePrincipalCollection;\n+import org.apache.shiro.util.ThreadContext;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import ddf.catalog.CatalogFramework;\n+import ddf.catalog.data.BinaryContent;\n+import ddf.catalog.data.Metacard;\n+import ddf.catalog.data.dynamic.api.DynamicMetacard;\n+import ddf.catalog.data.dynamic.api.MetacardFactory;\n+import ddf.catalog.data.dynamic.impl.MetacardFactoryImpl;\n+import ddf.catalog.data.impl.MetacardImpl;\n+import ddf.catalog.operation.Update;\n+import ddf.catalog.operation.impl.UpdateImpl;\n+import ddf.catalog.source.IngestException;\n+import ddf.catalog.transform.CatalogTransformerException;\n+import ddf.catalog.transform.InputTransformer;\n+import ddf.content.data.ContentItem;\n+import ddf.content.operation.CreateRequest;\n+import ddf.content.operation.CreateResponse;\n+import ddf.content.operation.DeleteResponse;\n+import ddf.content.operation.UpdateRequest;\n+import ddf.content.operation.UpdateResponse;\n+import ddf.content.plugin.ContentPlugin;\n+import ddf.content.plugin.PluginExecutionException;\n+import ddf.mime.MimeTypeToTransformerMapper;\n+import ddf.security.SecurityConstants;\n+import ddf.security.Subject;\n+\n+public class TestCatalogContentPlugin {\n+\n+    private static final String DEFAULT_METACARD_TRANSFORMER = \"geojson\";\n+    private static final String MIME_BASE = \"text\";\n+    private static final String MIME_SUB = \"plain\";\n+    private static final String MIME_TYPE = MIME_BASE + \"/\" + MIME_SUB;\n+    private static final String TEST_USER_NAME = \"TestUser\";\n+    private static final String TEST_REALM = \"testrealm\";\n+    private static final String TEST_DATA = \"Test String From InputStream\";\n+    private static final String TEST_URI = \"http://localhost/test.jpg\";\n+    private static final String BAD_URI = \"bad uri\";\n+\n+    private CatalogFramework mockCatalogFramework = mock(CatalogFramework.class);\n+    private MimeTypeToTransformerMapper mockMimeTypeToTransformerMapper = mock(MimeTypeToTransformerMapper.class);\n+    private BinaryContent mockBinaryContent = mock(BinaryContent.class);\n+    private CreateRequest mockCreateRequest = mock(CreateRequest.class);\n+    private UpdateRequest mockUpdateRequest = mock(UpdateRequest.class);\n+    private CreateResponse mockInputCreateResponse = mock(CreateResponse.class);","path":"catalog/content/core/content-core-catalogerplugin/src/test/java/ddf/content/plugin/cataloger/TestCatalogContentPlugin.java","position":null,"original_position":87,"commit_id":"08d89ce08471aa759b664c821d18304966b8ac79","original_commit_id":"cc299c3bde2c3659934467c518377b59d7044e2d","user":{"login":"troymohl","id":17255437,"avatar_url":"https://avatars.githubusercontent.com/u/17255437?v=3","gravatar_id":"","url":"https://api.github.com/users/troymohl","html_url":"https://github.com/troymohl","followers_url":"https://api.github.com/users/troymohl/followers","following_url":"https://api.github.com/users/troymohl/following{/other_user}","gists_url":"https://api.github.com/users/troymohl/gists{/gist_id}","starred_url":"https://api.github.com/users/troymohl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troymohl/subscriptions","organizations_url":"https://api.github.com/users/troymohl/orgs","repos_url":"https://api.github.com/users/troymohl/repos","events_url":"https://api.github.com/users/troymohl/events{/privacy}","received_events_url":"https://api.github.com/users/troymohl/received_events","type":"User","site_admin":false},"body":"I have renamed all of these to better reflect what they are.","created_at":"2016-03-04T18:19:05Z","updated_at":"2016-03-04T18:19:05Z","html_url":"https://github.com/codice/ddf/pull/596#discussion_r55066782","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/596","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/55066782"},"html":{"href":"https://github.com/codice/ddf/pull/596#discussion_r55066782"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/596"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/596","id":61731589,"html_url":"https://github.com/codice/ddf/pull/596","diff_url":"https://github.com/codice/ddf/pull/596.diff","patch_url":"https://github.com/codice/ddf/pull/596.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/596","number":596,"state":"open","locked":false,"title":"DDF-1912 Adding tests for Catalog Content Plugin","user":{"login":"troymohl","id":17255437,"avatar_url":"https://avatars.githubusercontent.com/u/17255437?v=3","gravatar_id":"","url":"https://api.github.com/users/troymohl","html_url":"https://github.com/troymohl","followers_url":"https://api.github.com/users/troymohl/followers","following_url":"https://api.github.com/users/troymohl/following{/other_user}","gists_url":"https://api.github.com/users/troymohl/gists{/gist_id}","starred_url":"https://api.github.com/users/troymohl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troymohl/subscriptions","organizations_url":"https://api.github.com/users/troymohl/orgs","repos_url":"https://api.github.com/users/troymohl/repos","events_url":"https://api.github.com/users/troymohl/events{/privacy}","received_events_url":"https://api.github.com/users/troymohl/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nAdds tests for Catalog Content Plugin\r\n#### Who is reviewing it?\r\n@jaymcnallie \r\n@jlcsmith \r\n@kcwire \r\n@jrnorth \r\n#### How should this be tested?\r\nJUnit test cases.\r\n#### Any background context you want to provide?\r\n#### What are the relevant tickets?\r\nDDF-1912\r\n#### Screenshots (if appropriate)\r\n#### Checklist:\r\n- [ ] Documentation Updated\r\n- [ X ] Update / Add Unit Tests\r\n- [ ] Update / Add Integration Tests\r\n\r\n","created_at":"2016-03-04T16:01:53Z","updated_at":"2016-03-04T18:19:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcc63ad9c949b2086582bac7d42f563a02102c69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/596/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/596/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/596/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/08d89ce08471aa759b664c821d18304966b8ac79","head":{"label":"troymohl:DDF-1912","ref":"DDF-1912","sha":"08d89ce08471aa759b664c821d18304966b8ac79","user":{"login":"troymohl","id":17255437,"avatar_url":"https://avatars.githubusercontent.com/u/17255437?v=3","gravatar_id":"","url":"https://api.github.com/users/troymohl","html_url":"https://github.com/troymohl","followers_url":"https://api.github.com/users/troymohl/followers","following_url":"https://api.github.com/users/troymohl/following{/other_user}","gists_url":"https://api.github.com/users/troymohl/gists{/gist_id}","starred_url":"https://api.github.com/users/troymohl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troymohl/subscriptions","organizations_url":"https://api.github.com/users/troymohl/orgs","repos_url":"https://api.github.com/users/troymohl/repos","events_url":"https://api.github.com/users/troymohl/events{/privacy}","received_events_url":"https://api.github.com/users/troymohl/received_events","type":"User","site_admin":false},"repo":{"id":51781237,"name":"ddf","full_name":"troymohl/ddf","owner":{"login":"troymohl","id":17255437,"avatar_url":"https://avatars.githubusercontent.com/u/17255437?v=3","gravatar_id":"","url":"https://api.github.com/users/troymohl","html_url":"https://github.com/troymohl","followers_url":"https://api.github.com/users/troymohl/followers","following_url":"https://api.github.com/users/troymohl/following{/other_user}","gists_url":"https://api.github.com/users/troymohl/gists{/gist_id}","starred_url":"https://api.github.com/users/troymohl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troymohl/subscriptions","organizations_url":"https://api.github.com/users/troymohl/orgs","repos_url":"https://api.github.com/users/troymohl/repos","events_url":"https://api.github.com/users/troymohl/events{/privacy}","received_events_url":"https://api.github.com/users/troymohl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/troymohl/ddf","description":"The Distributed Data Framework - Federated Open Geospatial Consortium (OGC) filter powered metadata catalog with SAML Web SSO secured container","fork":true,"url":"https://api.github.com/repos/troymohl/ddf","forks_url":"https://api.github.com/repos/troymohl/ddf/forks","keys_url":"https://api.github.com/repos/troymohl/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/troymohl/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/troymohl/ddf/teams","hooks_url":"https://api.github.com/repos/troymohl/ddf/hooks","issue_events_url":"https://api.github.com/repos/troymohl/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/troymohl/ddf/events","assignees_url":"https://api.github.com/repos/troymohl/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/troymohl/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/troymohl/ddf/tags","blobs_url":"https://api.github.com/repos/troymohl/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/troymohl/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/troymohl/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/troymohl/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/troymohl/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/troymohl/ddf/languages","stargazers_url":"https://api.github.com/repos/troymohl/ddf/stargazers","contributors_url":"https://api.github.com/repos/troymohl/ddf/contributors","subscribers_url":"https://api.github.com/repos/troymohl/ddf/subscribers","subscription_url":"https://api.github.com/repos/troymohl/ddf/subscription","commits_url":"https://api.github.com/repos/troymohl/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/troymohl/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/troymohl/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/troymohl/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/troymohl/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/troymohl/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/troymohl/ddf/merges","archive_url":"https://api.github.com/repos/troymohl/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/troymohl/ddf/downloads","issues_url":"https://api.github.com/repos/troymohl/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/troymohl/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/troymohl/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/troymohl/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/troymohl/ddf/labels{/name}","releases_url":"https://api.github.com/repos/troymohl/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/troymohl/ddf/deployments","created_at":"2016-02-15T19:53:31Z","updated_at":"2016-02-15T19:53:43Z","pushed_at":"2016-03-04T18:16:00Z","git_url":"git://github.com/troymohl/ddf.git","ssh_url":"git@github.com:troymohl/ddf.git","clone_url":"https://github.com/troymohl/ddf.git","svn_url":"https://github.com/troymohl/ddf","homepage":"","size":130507,"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":"codice:master","ref":"master","sha":"d772890136ffd421122e56150a7bcf9259add305","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"The Distributed Data Framework - Federated Open Geospatial Consortium (OGC) filter powered metadata catalog with SAML Web SSO secured container","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/codice/ddf/deployments","created_at":"2013-12-13T20:38:28Z","updated_at":"2016-02-23T03:59:25Z","pushed_at":"2016-03-04T18:16:01Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"","size":146185,"stargazers_count":33,"watchers_count":33,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":70,"mirror_url":null,"open_issues_count":16,"forks":70,"open_issues":16,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/596"},"html":{"href":"https://github.com/codice/ddf/pull/596"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/596"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/596/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/596/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/596/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/08d89ce08471aa759b664c821d18304966b8ac79"}}}}