GitHub PullRequestReviewCommentEvent at 2014-04-16 15:02:25
Repository: jenkins
Actor: jglick
Payload: {"comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/11688366","id":11688366,"diff_hunk":"@@ -160,8 +162,59 @@ public void testGetUser() {\n         User user4 = User.get(\"Marie\",false, Collections.EMPTY_MAP);\n         assertNull(\"User should not be created because Marie does not exists.\", user4);\n     }\n+\n+    @Test\n+    public void caseInsensitivity() {\n+        j.jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(true, false, null){\n+            @Override\n+            public IdStrategy getUserIdStrategy() {\n+                return new IdStrategy.CaseInsensitive();\n+            }\n+        });\n+        User user = User.get(\"john smith\");\n+        User user2 = User.get(\"John Smith\");\n+        assertSame(\"Users should have the same id.\", user.getId(), user2.getId());\n+    }\n     \n     @Test\n+    public void caseSensitivity() {\n+        j.jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(true, false, null){\n+            @Override\n+            public IdStrategy getUserIdStrategy() {\n+                return new IdStrategy.CaseSensitive();\n+            }\n+        });\n+        User user = User.get(\"john smith\");\n+        User user2 = User.get(\"John Smith\");\n+        assertNotSame(\"Users should not have the same id.\", user.getId(), user2.getId());\n+        assertEquals(\"john smith\", User.idStrategy().keyFor(user.getId()));\n+        assertEquals(\"john smith\", User.idStrategy().filenameOf(user.getId()));\n+        assertEquals(\"John Smith\", User.idStrategy().keyFor(user2.getId()));\n+        assertEquals(\"^john ^smith\", User.idStrategy().filenameOf(user2.getId()));\n+    }\n+\n+    @Test\n+    public void caseSensitivityEmail() {\n+        j.jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(true, false, null){\n+            @Override\n+            public IdStrategy getUserIdStrategy() {\n+                return new IdStrategy.CaseSensitiveEmailAddress();\n+            }\n+        });\n+        User user = User.get(\"john.smith@acme.org\");\n+        User user2 = User.get(\"John.Smith@acme.org\");\n+        assertNotSame(\"Users should not have the same id.\", user.getId(), user2.getId());\n+        assertEquals(\"john.smith@acme.org\", User.idStrategy().keyFor(user.getId()));\n+        assertEquals(\"john.smith$0040acme.org\", User.idStrategy().filenameOf(user.getId()));","path":"test/src/test/java/hudson/model/UserTest.java","position":56,"original_position":56,"commit_id":"1c6734098ca068b66bbd1abab30353d7a4f1c5e4","original_commit_id":"1c6734098ca068b66bbd1abab30353d7a4f1c5e4","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?","gravatar_id":"1491b11fe484af03f7beff7f1c39bf8a","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"This looks like it would be a major incompatibility. Can `@` be left raw? AFAIK it is safe on most filesystems.","created_at":"2014-04-16T15:02:25Z","updated_at":"2014-04-16T15:02:25Z","html_url":"https://github.com/jenkinsci/jenkins/pull/1161#discussion_r11688366","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1161","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/11688366"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1161#discussion_r11688366"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1161"}}}}