@@ -0,0 +1,1893 @@
+package jenkins.model.identity;%0A%0Aimport com.gargoylesoftware.htmlunit.html.HtmlPage;%0Aimport hudson.ExtensionList;%0Aimport hudson.model.UnprotectedRootAction;%0Aimport java.security.KeyPair;%0Aimport java.security.KeyPairGenerator;%0Aimport java.security.NoSuchAlgorithmException;%0Aimport java.security.cert.X509Certificate;%0Aimport java.security.interfaces.RSAPrivateKey;%0Aimport java.security.interfaces.RSAPublicKey;%0Aimport java.security.spec.InvalidKeySpecException;%0Aimport javax.annotation.Nullable;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.hudson.test.JenkinsRule;%0Aimport org.jvnet.hudson.test.TestExtension;%0A%0Aimport static org.hamcrest.Matchers.containsString;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class IdentityRootActionTest %7B%0A%0A    @Rule%0A    public JenkinsRule r = new JenkinsRule();%0A%0A    @Test%0A    public void ui() throws Exception %7B%0A        HtmlPage p = r.createWebClient().goTo(%22instance-identity%22);%0A        assertThat(p.getElementById(%22fingerprint%22).getTextContent(),%0A                containsString(ExtensionList.lookup(UnprotectedRootAction.class).get(IdentityRootAction.class).getFingerprint()));%0A    %7D%0A%0A    @TestExtension // TODO remove once instance-identity with provider impl embedded in war%0A    public static class ProviderImpl extends InstanceIdentityProvider%3CRSAPublicKey,RSAPrivateKey%3E %7B%0A%0A        private final KeyPair keyPair;%0A%0A        public ProviderImpl() throws NoSuchAlgorithmException, InvalidKeySpecException %7B%0A            KeyPairGenerator generator = KeyPairGenerator.getInstance(%22RSA%22);%0A            generator.initialize(1024);%0A            this.keyPair = generator.generateKeyPair();%0A        %7D%0A%0A        @Nullable%0A        @Override%0A        public KeyPair getKeyPair() %7B%0A            return keyPair;%0A        %7D%0A%0A        @Nullable%0A        @Override%0A        public X509Certificate getCertificate() %7B%0A            return null;%0A        %7D%0A    %7D%0A%7D%0A

Add a test for the /instance-identity root action