@BeforeAll
    public static void generateValidKeyAndCert() throws Exception {
        Fixtures.reconfigureOpenfireHome();
        Fixtures.disableDatabasePersistence();
        JiveGlobals.setProperty("xmpp.domain", Fixtures.XMPP_DOMAIN);
        JiveGlobals.setProperty("xmpp.socket.netty.graceful-shutdown.quiet-period", "0");
        JiveGlobals.setProperty("xmpp.socket.netty.graceful-shutdown.timeout", "0");
        final XMPPServer xmppServer = Fixtures.mockXMPPServer();
        XMPPServer.setInstance(xmppServer);

        final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
        final File tmpValidIdentityStoreFile = new File(tmpDir, "unittest-identitystorevalid-" + System.currentTimeMillis() + ".jks");
        tmpValidIdentityStoreFile.deleteOnExit();
        try {
            final CertificateStoreConfiguration identityStoreConfig = new CertificateStoreConfiguration("jks", tmpValidIdentityStoreFile, "secret".toCharArray(), tmpDir);
            final IdentityStore validStore = new IdentityStore(identityStoreConfig, true);
            validStore.ensureDomainCertificate();
            final Enumeration<String> aliases = validStore.getStore().aliases();
            while (aliases.hasMoreElements()) {
                String alias = aliases.nextElement();
                if (validStore.getStore().isKeyEntry(alias)) {
                    FIXTURE_VALID_KEY = validStore.getStore().getKey(alias, "secret".toCharArray());
                    FIXTURE_VALID_CERTIFICATE_CHAIN = validStore.getStore().getCertificateChain(alias);
                    return;
                }
            }
        } finally {
            tmpValidIdentityStoreFile.delete();
        }
    }
Generates (one time) content for a 'valid' identity store: a private key and associated (self-signed) certificate
chain.

This generated artifacts are stored in static fields, intended to be re-used by different tests. This prevents
each test from having to generate them, which saves around 66% of the CPU time that's consumed by the tests.
xmppserver/src/test/java/org/jivesoftware/openfire/session/LocalOutgoingServerSessionTest.java