diff --git a/src/test/java/com/cloudbees/plugins/credentials/casc/CredentialsCategoryTest.java b/src/test/java/com/cloudbees/plugins/credentials/casc/CredentialsCategoryTest.java index 05f722992..e59ad06eb 100644 --- a/src/test/java/com/cloudbees/plugins/credentials/casc/CredentialsCategoryTest.java +++ b/src/test/java/com/cloudbees/plugins/credentials/casc/CredentialsCategoryTest.java @@ -17,6 +17,8 @@ import static io.jenkins.plugins.casc.misc.Util.toYamlString; import io.jenkins.plugins.casc.model.CNode; import java.io.ByteArrayOutputStream; +import java.io.InputStream; + import jenkins.model.GlobalConfiguration; import jenkins.model.GlobalConfigurationCategory; import static org.hamcrest.CoreMatchers.equalTo; @@ -101,12 +103,13 @@ public void exportUsernamePasswordCredentialsImplConfiguration() throws Exceptio @Test public void exportCertificateCredentialsImplConfiguration() throws Exception { + byte[] p12Bytes = CertificateCredentialsImpl.class.getResourceAsStream("test.p12").readAllBytes(); CertificateCredentialsImpl certificateCredentials = new CertificateCredentialsImpl(CredentialsScope.GLOBAL, "credential-certificate", "Credential with certificate", "password", - new CertificateCredentialsImpl.UploadedKeyStoreSource(null, SecretBytes.fromBytes("Testing not real certificate".getBytes()))); + new CertificateCredentialsImpl.UploadedKeyStoreSource(null, SecretBytes.fromBytes(p12Bytes))); SystemCredentialsProvider.getInstance().getCredentials().add(certificateCredentials); ByteArrayOutputStream out = new ByteArrayOutputStream();