@Test public void testParseWhitelistOperationGrant() { WhitelistOperation operation = parser.parseWhitelistOperation("grant_audit_whitelist_for_select"); assertThat(operation).isEqualTo(WhitelistOperation.GRANT); }
WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } }
WhitelistOptionParser { WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } } }
WhitelistOptionParser { WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } }  }
WhitelistOptionParser { WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } }   }
WhitelistOptionParser { WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } }    }