NamedOperationCache { public NamedOperationDetail getNamedOperation(final String name, final User user) throws CacheOperationFailedException { return get(name, user, null); }  void addNamedOperation(final NamedOperationDetail namedOperation, final boolean overwrite, final User user); void addNamedOperation(final NamedOperationDetail namedOperation, final boolean overwrite, final User user, final String adminAuth); void deleteNamedOperation(final String name, final User user); void deleteNamedOperation(final String name, final User user, final String adminAuth); NamedOperationDetail getNamedOperation(final String name, final User user); NamedOperationDetail getNamedOperation(final String name, final User user, final String adminAuth); CloseableIterable<NamedOperationDetail> getAllNamedOperations(final User user); CloseableIterable<NamedOperationDetail> getAllNamedOperations(final User user, final String adminAuth); void clear(); void deleteFromCache(final String name); void addToCache(final String name, final NamedOperationDetail operation, final boolean overwrite); NamedOperationDetail getFromCache(final String name);  }
@Test public void shouldThrowExceptionWhenGettingIfKeyIsNull() throws CacheOperationFailedException { assertThrows(CacheOperationFailedException.class, () -> cache.getNamedOperation(null, advancedUser)); }