@Test
  public void shouldUpdatePublicKey() throws Exception {
    IOpenShiftSSHKey key = null;
    try {
      // pre-conditions
      String publicKeyPath = createRandomTempFile().getAbsolutePath();
      String privateKeyPath = createRandomTempFile().getAbsolutePath();
      SSHKeyPair keyPair =
          SSHKeyPair.create(
              SSHKeyType.SSH_RSA,
              SSHKeyTestUtils.DEFAULT_PASSPHRASE,
              privateKeyPath,
              publicKeyPath);
      String keyName = SSHKeyTestUtils.createRandomKeyName();
      key = user.addSSHKey(keyName, keyPair);

      // operation
      String publicKey =
          SSHKeyPair.create(
                  SSHKeyType.SSH_RSA,
                  SSHKeyTestUtils.DEFAULT_PASSPHRASE,
                  privateKeyPath,
                  publicKeyPath)
              .getPublicKey();
      key.setPublicKey(publicKey);

      // verification
      assertThat(key.getPublicKey()).isEqualTo(publicKey);
      IOpenShiftSSHKey openshiftKey = user.getSSHKeyByName(keyName);
      assertThat(new SSHPublicKeyAssertion(openshiftKey))
          .hasName(keyName)
          .hasPublicKey(publicKey)
          .isType(openshiftKey.getKeyType());
    } finally {
      SSHKeyTestUtils.silentlyDestroyKey(key);
    }
  }