@@ -40,31 +40,48 @@ public class GithubSecurityRealmTest {
4040
4141 @ Test
4242 public void testEquals_true () {
43- GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
44- GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
43+ GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" );
44+ GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" );
45+ GithubSecurityRealm c = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
46+ GithubSecurityRealm d = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
4547 assertTrue (a .equals (b ));
48+ assertTrue (b .equals (c ));
49+ assertTrue (c .equals (b ));
50+ assertTrue (c .equals (d ));
4651 }
4752
4853 @ Test
4954 public void testEquals_false () {
50- GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
51- GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,repo" , "" , false );
55+ GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" );
56+ GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,repo" );
57+ GithubSecurityRealm c = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org" , "" , false );
58+ GithubSecurityRealm d = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,repo" , "" , false );
5259 assertFalse (a .equals (b ));
60+ assertFalse (a .equals (d ));
5361 assertFalse (a .equals ("" ));
62+ assertFalse (c .equals (b ));
63+ assertFalse (c .equals (d ));
64+ assertFalse (c .equals ("" ));
5465 }
5566
5667 @ Test
5768 public void testHasScope_true () {
5869 GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,user,user:email" , "" , false );
70+ GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,user,user:email" );
5971 assertTrue (a .hasScope ("user" ));
6072 assertTrue (a .hasScope ("read:org" ));
6173 assertTrue (a .hasScope ("user:email" ));
74+ assertTrue (b .hasScope ("user" ));
75+ assertTrue (b .hasScope ("read:org" ));
76+ assertTrue (b .hasScope ("user:email" ));
6277 }
6378
6479 @ Test
6580 public void testHasScope_false () {
66- GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,user,user:email" , "" , false );
81+ GithubSecurityRealm a = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,user,user:email" );
82+ GithubSecurityRealm b = new GithubSecurityRealm ("http://jenkins.acme.com" , "http://jenkins.acme.com/api/v3" , "someid" , "somesecret" , "read:org,user,user:email" , "" , false );
6783 assertFalse (a .hasScope ("somescope" ));
84+ assertFalse (b .hasScope ("somescope" ));
6885 }
6986
7087 @ Test
0 commit comments