@Test public void executeNotSecureQueryWithProgrammingRight() throws QueryException { this.hasProgrammingRight = true; Query query = mock(Query.class); this.executor.execute(query); }
@Override public <T> List<T> execute(Query query) throws QueryException { if (query instanceof SecureQuery) { SecureQuery secureQuery = (SecureQuery) query; secureQuery.checkCurrentAuthor(true); } else if (!this.authorization.hasAccess(Right.PROGRAM)) { throw new QueryException("Unsecure query require programming right", query, null); } return this.defaultQueryExecutorManager.execute(query); }
SecureQueryExecutorManager implements QueryExecutorManager { @Override public <T> List<T> execute(Query query) throws QueryException { if (query instanceof SecureQuery) { SecureQuery secureQuery = (SecureQuery) query; secureQuery.checkCurrentAuthor(true); } else if (!this.authorization.hasAccess(Right.PROGRAM)) { throw new QueryException("Unsecure query require programming right", query, null); } return this.defaultQueryExecutorManager.execute(query); } }
SecureQueryExecutorManager implements QueryExecutorManager { @Override public <T> List<T> execute(Query query) throws QueryException { if (query instanceof SecureQuery) { SecureQuery secureQuery = (SecureQuery) query; secureQuery.checkCurrentAuthor(true); } else if (!this.authorization.hasAccess(Right.PROGRAM)) { throw new QueryException("Unsecure query require programming right", query, null); } return this.defaultQueryExecutorManager.execute(query); }  }
SecureQueryExecutorManager implements QueryExecutorManager { @Override public <T> List<T> execute(Query query) throws QueryException { if (query instanceof SecureQuery) { SecureQuery secureQuery = (SecureQuery) query; secureQuery.checkCurrentAuthor(true); } else if (!this.authorization.hasAccess(Right.PROGRAM)) { throw new QueryException("Unsecure query require programming right", query, null); } return this.defaultQueryExecutorManager.execute(query); }  @Override List<T> execute(Query query); @Override Set<String> getLanguages(); }
SecureQueryExecutorManager implements QueryExecutorManager { @Override public <T> List<T> execute(Query query) throws QueryException { if (query instanceof SecureQuery) { SecureQuery secureQuery = (SecureQuery) query; secureQuery.checkCurrentAuthor(true); } else if (!this.authorization.hasAccess(Right.PROGRAM)) { throw new QueryException("Unsecure query require programming right", query, null); } return this.defaultQueryExecutorManager.execute(query); }  @Override List<T> execute(Query query); @Override Set<String> getLanguages();  }