Skip to content

Commit

Permalink
jenkinsci#60 is not a defect, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Feb 5, 2018
1 parent 579e97b commit 2e4f0ed
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.jenkinsci.plugins.casc;

import hudson.security.AuthorizationStrategy;
import hudson.security.FullControlOnceLoggedInAuthorizationStrategy;
import hudson.security.HudsonPrivateSecurityRealm;
import jenkins.model.Jenkins;
import org.hamcrest.CoreMatchers;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
Expand Down Expand Up @@ -43,7 +45,13 @@ public void shouldHaveAuthStrategyConfigurator() throws Exception {
Configurator c = Configurator.lookup(Jenkins.class);
Attribute attr = c.getAttribute("authorizationStrategy");
assertNotNull(attr);
assertNotEquals(JenkinsConfigurator.NOOP, attr.getSetter());
// Apparently Java always thinks that labmdas are equal
//assertTrue("The operation should not be NOOP", JenkinsConfigurator.NOOP != attr.getSetter());
attr.getSetter().setValue(j.jenkins, attr, new AuthorizationStrategy.Unsecured());

assertThat("Authorization strategy has not been set",
j.jenkins.getAuthorizationStrategy(),
CoreMatchers.instanceOf(AuthorizationStrategy.Unsecured.class));
}

}

0 comments on commit 2e4f0ed

Please sign in to comment.