{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/repose/pulls/comments/65592534","id":65592534,"diff_hunk":"@@ -19,39 +19,55 @@\n  */\n package org.openrepose.filters.versioning.util;\n \n-\n import com.fasterxml.jackson.databind.ObjectMapper;\n import org.apache.commons.io.FileUtils;\n import org.apache.commons.io.IOUtils;\n import org.custommonkey.xmlunit.Diff;\n-import org.junit.Before;\n import org.junit.Test;\n-import org.junit.experimental.runners.Enclosed;\n-import org.junit.runner.RunWith;\n import org.openrepose.commons.utils.http.media.MediaType;\n import org.openrepose.commons.utils.http.media.MimeType;\n import org.openrepose.commons.utils.transform.Transform;\n import org.openrepose.commons.utils.transform.jaxb.StreamToJaxbTransform;\n+import org.openrepose.filters.versioning.config.JsonFormat;\n import org.openrepose.filters.versioning.schema.VersionChoice;\n import org.openrepose.filters.versioning.schema.VersionChoiceList;\n \n import javax.xml.bind.JAXBContext;\n import javax.xml.bind.JAXBElement;\n import java.io.ByteArrayOutputStream;\n import java.io.File;\n+import java.io.IOException;\n import java.io.InputStream;\n+import java.io.UncheckedIOException;\n+import java.net.URISyntaxException;\n import java.util.Map;\n \n-import static org.junit.Assert.*;\n+import static org.hamcrest.CoreMatchers.equalTo;\n+import static org.hamcrest.CoreMatchers.not;\n+import static org.hamcrest.CoreMatchers.nullValue;\n+import static org.junit.Assert.assertThat;\n+import static org.junit.Assert.assertTrue;\n \n-/**\n- * @author jhopper\n- */\n-@RunWith(Enclosed.class)\n+// suppress unchecked assignment warnings in the static initializer\n+@SuppressWarnings(\"unchecked\")\n public class ContentTransformerTest {\n \n+    private static final String EXAMPLES_DIR = \"/META-INF/schema/examples/\";\n+    private static final String XML_VERSION = EXAMPLES_DIR + \"xml/version.xml\";\n+    private static final String XML_VERSIONS = EXAMPLES_DIR + \"xml/versions.xml\";\n+    private static final String JSON_VERSION = EXAMPLES_DIR + \"json/version.json\";\n+    private static final String JSON_VERSIONS = EXAMPLES_DIR + \"json/versions.json\";\n+    private static final String JSON_VERSION_IDENTITY = EXAMPLES_DIR + \"json/version-identity.json\";\n+    private static final String JSON_VERSIONS_IDENTITY = EXAMPLES_DIR + \"json/versions-identity.json\";\n+    private static final String XML_CHOICES = EXAMPLES_DIR + \"xml/choices.xml\";\n+    private static final String JSON_CHOICES = EXAMPLES_DIR + \"json/choices.json\";\n+\n     private static final Transform<InputStream, JAXBElement<?>> xmlTransformer;\n \n+    private ObjectMapper mapper = new ObjectMapper();\n+    private String versionXmlFileReader = getFileAsString(XML_VERSION);\n+    private String versionsXmlFileReader = getFileAsString(XML_VERSIONS);\n+\n     static {","path":"repose-aggregator/components/filters/versioning-filter/src/test/java/org/openrepose/filters/versioning/util/ContentTransformerTest.java","position":62,"original_position":62,"commit_id":"7368eaf3ee6981039a390781ac68582cd9058ed9","original_commit_id":"7368eaf3ee6981039a390781ac68582cd9058ed9","user":{"login":"adrianjgeorge","id":997130,"avatar_url":"https://avatars.githubusercontent.com/u/997130?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianjgeorge","html_url":"https://github.com/adrianjgeorge","followers_url":"https://api.github.com/users/adrianjgeorge/followers","following_url":"https://api.github.com/users/adrianjgeorge/following{/other_user}","gists_url":"https://api.github.com/users/adrianjgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianjgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianjgeorge/subscriptions","organizations_url":"https://api.github.com/users/adrianjgeorge/orgs","repos_url":"https://api.github.com/users/adrianjgeorge/repos","events_url":"https://api.github.com/users/adrianjgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/adrianjgeorge/received_events","type":"User","site_admin":false},"body":"does this need to be static or would it be better served as a `@Before` or `@BeforeClass`?","created_at":"2016-06-02T18:25:15Z","updated_at":"2016-06-02T18:25:15Z","html_url":"https://github.com/rackerlabs/repose/pull/1546#discussion_r65592534","pull_request_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1546","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/comments/65592534"},"html":{"href":"https://github.com/rackerlabs/repose/pull/1546#discussion_r65592534"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1546"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/repose/pulls/1546","id":72063784,"html_url":"https://github.com/rackerlabs/repose/pull/1546","diff_url":"https://github.com/rackerlabs/repose/pull/1546.diff","patch_url":"https://github.com/rackerlabs/repose/pull/1546.patch","issue_url":"https://api.github.com/repos/rackerlabs/repose/issues/1546","number":1546,"state":"open","locked":false,"title":"REP-3844 - Versioning for Identity","user":{"login":"Mario-Lopez","id":6766560,"avatar_url":"https://avatars.githubusercontent.com/u/6766560?v=3","gravatar_id":"","url":"https://api.github.com/users/Mario-Lopez","html_url":"https://github.com/Mario-Lopez","followers_url":"https://api.github.com/users/Mario-Lopez/followers","following_url":"https://api.github.com/users/Mario-Lopez/following{/other_user}","gists_url":"https://api.github.com/users/Mario-Lopez/gists{/gist_id}","starred_url":"https://api.github.com/users/Mario-Lopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mario-Lopez/subscriptions","organizations_url":"https://api.github.com/users/Mario-Lopez/orgs","repos_url":"https://api.github.com/users/Mario-Lopez/repos","events_url":"https://api.github.com/users/Mario-Lopez/events{/privacy}","received_events_url":"https://api.github.com/users/Mario-Lopez/received_events","type":"User","site_admin":false},"body":"The primary logic is in ContentTransformer, so I cleaned up the unit tests and added additional tests to verify the correct format in the COMPUTE (default and existing behavior) and IDENTITY (new) formats.\r\n\r\nI updated the config schema to add an optional \"json-schema\" attribute that defaults to COMPUTE (the existing behavior) and can be set to IDENTITY for the new JSON format.\r\n\r\nVersioningFilter was updated to take the config value and pass it to ContentTransformer.\r\n\r\nI updated the Versioning filter functional test to also verify the JSON structure of the COMPUTE format.  Previously it was just doing a string.contains to verify stuff.","created_at":"2016-05-31T18:31:46Z","updated_at":"2016-06-02T18:25:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8cbd1fe65ceec283571e35a1549b6dea9d3a4bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1546/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1546/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/repose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/repose/issues/1546/comments","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/7368eaf3ee6981039a390781ac68582cd9058ed9","head":{"label":"rackerlabs:REP-3844-versioning-for-identity","ref":"REP-3844-versioning-for-identity","sha":"7368eaf3ee6981039a390781ac68582cd9058ed9","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1981821,"name":"repose","full_name":"rackerlabs/repose","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/repose","description":"The powerful, programmable, API Middleware Platform","fork":false,"url":"https://api.github.com/repos/rackerlabs/repose","forks_url":"https://api.github.com/repos/rackerlabs/repose/forks","keys_url":"https://api.github.com/repos/rackerlabs/repose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/repose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/repose/teams","hooks_url":"https://api.github.com/repos/rackerlabs/repose/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/repose/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/repose/events","assignees_url":"https://api.github.com/repos/rackerlabs/repose/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/repose/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/repose/tags","blobs_url":"https://api.github.com/repos/rackerlabs/repose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/repose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/repose/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/repose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/repose/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/repose/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/repose/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/repose/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/repose/subscription","commits_url":"https://api.github.com/repos/rackerlabs/repose/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/repose/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/repose/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/repose/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/repose/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/repose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/repose/merges","archive_url":"https://api.github.com/repos/rackerlabs/repose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/repose/downloads","issues_url":"https://api.github.com/repos/rackerlabs/repose/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/repose/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/repose/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/repose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/repose/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/repose/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/repose/deployments","created_at":"2011-07-01T04:39:34Z","updated_at":"2016-05-27T12:26:26Z","pushed_at":"2016-06-02T18:20:39Z","git_url":"git://github.com/rackerlabs/repose.git","ssh_url":"git@github.com:rackerlabs/repose.git","clone_url":"https://github.com/rackerlabs/repose.git","svn_url":"https://github.com/rackerlabs/repose","homepage":"http://www.openrepose.org/","size":103020,"stargazers_count":246,"watchers_count":246,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":72,"mirror_url":null,"open_issues_count":8,"forks":72,"open_issues":8,"watchers":246,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"a205672cf92f5374b807751f712bed0dfc8664c5","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1981821,"name":"repose","full_name":"rackerlabs/repose","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/repose","description":"The powerful, programmable, API Middleware Platform","fork":false,"url":"https://api.github.com/repos/rackerlabs/repose","forks_url":"https://api.github.com/repos/rackerlabs/repose/forks","keys_url":"https://api.github.com/repos/rackerlabs/repose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/repose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/repose/teams","hooks_url":"https://api.github.com/repos/rackerlabs/repose/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/repose/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/repose/events","assignees_url":"https://api.github.com/repos/rackerlabs/repose/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/repose/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/repose/tags","blobs_url":"https://api.github.com/repos/rackerlabs/repose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/repose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/repose/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/repose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/repose/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/repose/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/repose/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/repose/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/repose/subscription","commits_url":"https://api.github.com/repos/rackerlabs/repose/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/repose/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/repose/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/repose/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/repose/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/repose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/repose/merges","archive_url":"https://api.github.com/repos/rackerlabs/repose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/repose/downloads","issues_url":"https://api.github.com/repos/rackerlabs/repose/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/repose/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/repose/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/repose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/repose/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/repose/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/repose/deployments","created_at":"2011-07-01T04:39:34Z","updated_at":"2016-05-27T12:26:26Z","pushed_at":"2016-06-02T18:20:39Z","git_url":"git://github.com/rackerlabs/repose.git","ssh_url":"git@github.com:rackerlabs/repose.git","clone_url":"https://github.com/rackerlabs/repose.git","svn_url":"https://github.com/rackerlabs/repose","homepage":"http://www.openrepose.org/","size":103020,"stargazers_count":246,"watchers_count":246,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":72,"mirror_url":null,"open_issues_count":8,"forks":72,"open_issues":8,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1546"},"html":{"href":"https://github.com/rackerlabs/repose/pull/1546"},"issue":{"href":"https://api.github.com/repos/rackerlabs/repose/issues/1546"},"comments":{"href":"https://api.github.com/repos/rackerlabs/repose/issues/1546/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1546/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1546/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/repose/statuses/7368eaf3ee6981039a390781ac68582cd9058ed9"}}}}
{"actor":{"display_login":"adrianjgeorge"}}