@Test(expected = IllegalArgumentException.class)
public void updateThrowsIfMetadataHasBadKeys() throws Exception {

  updateActionConfig.name = secret.getDisplayName();
  updateActionConfig.json = "{\"ThisIsABadKey\":\"doh\"}";
  updateAction.stream = new ByteArrayInputStream(base64Decoder.decode(secret.getSecret()));
  when(keywhizClient.getSanitizedSecretByName(secret.getName()))
      .thenThrow(new NotFoundException()); // Call checks for existence.
  updateAction.run();
}