Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;

import java.io.IOException;
import jenkins.model.Jenkins;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.RealJenkinsRule;
import org.jvnet.hudson.test.RealJenkinsRule.JenkinsStartupException;

public class FIPSComplianceCheckTest {

Expand All @@ -27,7 +27,7 @@ public void testStartupNonFips() throws Throwable {
@Test
public void testStartupFips() throws Throwable {
rjr.javaOptions("-Xmx128M", "-Djenkins.security.FIPS140.COMPLIANCE=true");
JenkinsStartupException jse = assertThrows(JenkinsStartupException.class, () -> {
IOException jse = assertThrows(IOException.class, () -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, or just do not assert the exception type at all.

rjr.then(r -> {
Jenkins.get().getPluginManager().uberClassLoader.loadClass("net.i2p.crypto.eddsa.EdDSAEngine");
fail("should not get here!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW this is redundant. I think the whole assertion could be something like

assertThat(assertThrows(Throwable.class, () -> rjr.run(r -> r.jenkins.pluginManager.uberClassLoader.loadClass("net.i2p.crypto.eddsa.EdDSAEngine"))).getMessage(),
                containsString(
                        "The eddsa-api plugin is not FIPS compliant and can not be used in a Jenkins configured to run in FIPS-140 mode"));

Expand Down
Loading