### Question:
ZosmfJwkToPublicKey { public boolean updateJwtPublicKeyFile(String zosmfUrl, String filename, String caAlias, String caKeyStore, String caKeyStoreType, char[] caKeyStorePassword, char[] caKeyPassword) throws FileNotFoundException { try { String jwkJson = restTemplateWithoutKeystore.getForObject(zosmfUrl + "/jwt/ibm/api/zOSMFBuilder/jwk", String.class); JwkToPublicKeyConverter converter = new JwkToPublicKeyConverter(); String pem = converter.convertFirstPublicKeyJwkToPem(jwkJson, caAlias, caKeyStore, caKeyStoreType, caKeyStorePassword, caKeyPassword) ; try (PrintWriter out = new PrintWriter(filename)) { out.println(pem); } return true; } catch (HttpClientErrorException.NotFound e) { log.warn("Unable to read z/OSMF JWT public key. JWT support might be not configured in z/OSMF: {}", e.getMessage());; return false; } }  boolean updateJwtPublicKeyFile(String zosmfUrl, String filename, String caAlias, String caKeyStore,
    String caKeyStoreType, char[] caKeyStorePassword, char[] caKeyPassword);  }### Answer:
@Test void zosmfJwkIsConvertedToPublicKey() throws IOException { RestTemplate restTemplate = mock(RestTemplate.class); String jwk = "{\"keys\":[{\"kty\":\"RSA\",\"e\":\"AQAB\",\"use\":\"sig\",\"kid\":\"ozG_ySMHRsVQFmN1mVBeS-WtCupY1r-K7ewben09IBg\",\"alg\":\"RS256\",\"n\":\"wRdwksGIAR2A4cHsoOsYcGp5AmQl5ZjF5xIPXeyjkaLHmNTMvjixdWso1ecVlVeg_6pIXzMRhmOvmjXjz1PLfI2GD3drmeqsStjISWdDfH_rIQCYc9wYbWIZ3bQ0wFRDaVpZ6iOZ2iNcIevvZQKNw9frJthKSMM52JtsgwrgN--Ub2cKWioU_d52SC2SfDzOdnChqlU7xkqXwKXSUqcGM92A35dJJXkwbZhAHnDy5FST1HqYq27MOLzBkChw1bJQHZtlSqkxcHPxphnnbFKQmwRVUvyC5kfBemX-7Mzp1wDogt5lGvBAf3Eq8rFxaevAke327rM7q2KqO_LDMN2J-Q\"}]}"; when(restTemplate.getForObject("https: .thenReturn(jwk); ZosmfJwkToPublicKey zosmfJwkToPublicKey = new ZosmfJwkToPublicKey(restTemplate); File f = File.createTempFile("jwt", null, new File(System.getProperty("java.io.tmpdir"))); try { String filename = f.getName(); assertTrue(zosmfJwkToPublicKey.updateJwtPublicKeyFile("https: "../keystore/local_ca/localca.keystore.p12", "PKCS12", "local_ca_password".toCharArray(), "local_ca_password".toCharArray())); assertTrue(new String(Files.readAllBytes(Paths.get(filename))).contains("-----")); } finally { f.delete(); } }