### Question:
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();  }### Answer:
@Test public void executeNotSecureQueryWithoutProgrammingRight() { this.hasProgrammingRight = false; Query query = mock(Query.class); Throwable exception = assertThrows(QueryException.class, () -> { this.executor.execute(query); }); assertEquals("Unsecure query require programming right. Query statement = [null]", exception.getMessage()); }
@Test public void executeNotSecureQueryWithProgrammingRight() throws QueryException { this.hasProgrammingRight = true; Query query = mock(Query.class); this.executor.execute(query); }
@Test public void executeSecureQueryWithoutCheckCurrentAuthor() throws QueryException { DefaultQuery query = new DefaultQuery("statement", "language", this.executor); assertFalse(query.isCurrentAuthorChecked()); this.executor.execute(query); assertTrue(query.isCurrentAuthorChecked()); }