@Test public void testParseGrantGuck() { assertThatExceptionOfType(InvalidRequestException.class) .isThrownBy(() -> parser.parseTargetOperation("grant_audit_whitelist_for_guck", DataResource.fromName("data"))); }
Set<Permission> parseTargetOperation(String inputOption, IResource resource) { String operationString = stripOptionPrefix(inputOption).toUpperCase(); if (ALL_OPERATIONS.equals(operationString)) { return resource.applicablePermissions(); } try { return ImmutableSet.of(Permission.valueOf(operationString)); } catch (IllegalArgumentException e) { throw Exceptions.appendCause(new InvalidRequestException("Invalid whitelist option: " + e.getMessage()), e); } }
WhitelistOptionParser { Set<Permission> parseTargetOperation(String inputOption, IResource resource) { String operationString = stripOptionPrefix(inputOption).toUpperCase(); if (ALL_OPERATIONS.equals(operationString)) { return resource.applicablePermissions(); } try { return ImmutableSet.of(Permission.valueOf(operationString)); } catch (IllegalArgumentException e) { throw Exceptions.appendCause(new InvalidRequestException("Invalid whitelist option: " + e.getMessage()), e); } } }
WhitelistOptionParser { Set<Permission> parseTargetOperation(String inputOption, IResource resource) { String operationString = stripOptionPrefix(inputOption).toUpperCase(); if (ALL_OPERATIONS.equals(operationString)) { return resource.applicablePermissions(); } try { return ImmutableSet.of(Permission.valueOf(operationString)); } catch (IllegalArgumentException e) { throw Exceptions.appendCause(new InvalidRequestException("Invalid whitelist option: " + e.getMessage()), e); } }  }
WhitelistOptionParser { Set<Permission> parseTargetOperation(String inputOption, IResource resource) { String operationString = stripOptionPrefix(inputOption).toUpperCase(); if (ALL_OPERATIONS.equals(operationString)) { return resource.applicablePermissions(); } try { return ImmutableSet.of(Permission.valueOf(operationString)); } catch (IllegalArgumentException e) { throw Exceptions.appendCause(new InvalidRequestException("Invalid whitelist option: " + e.getMessage()), e); } }   }
WhitelistOptionParser { Set<Permission> parseTargetOperation(String inputOption, IResource resource) { String operationString = stripOptionPrefix(inputOption).toUpperCase(); if (ALL_OPERATIONS.equals(operationString)) { return resource.applicablePermissions(); } try { return ImmutableSet.of(Permission.valueOf(operationString)); } catch (IllegalArgumentException e) { throw Exceptions.appendCause(new InvalidRequestException("Invalid whitelist option: " + e.getMessage()), e); } }    }