@SuppressWarnings("unchecked")
@Test
public void executeTest() throws Exception {

    Project project = mock(Project.class);
    LogicalWorkflowExecutor logicalWorkflowExecutor = mock(LogicalWorkflowExecutor.class);
    Connection<MongoClient> connection = mock(Connection.class);
    ProjectParsed projectParsed = mock(ProjectParsed.class);
    PowerMockito.whenNew(ProjectParsed.class).withAnyArguments().thenReturn(projectParsed);
    PowerMockito.mockStatic(LogicalWorkflowExecutorFactory.class);
    PowerMockito.when(LogicalWorkflowExecutorFactory.getLogicalWorkflowExecutor(Matchers.any(ProjectParsed.class)))
            .thenReturn(logicalWorkflowExecutor);
    ResultSet resultSet = mock(ResultSet.class);
    when(logicalWorkflowExecutor.executeQuery(connection)).thenReturn(resultSet);
    QueryResult queryResult = mock(QueryResult.class);
    PowerMockito.mockStatic(QueryResult.class);
    PowerMockito.when(QueryResult.createQueryResult(resultSet, 0, true)).thenReturn(queryResult);
    QueryResult returnQueryResult = mongoQueryEngine.execute(project, connection);
    verify(logicalWorkflowExecutor, times(1)).executeQuery(connection);
    PowerMockito.verifyStatic(times(1));
    QueryResult.createQueryResult(resultSet, 0, true);
    assertEquals("The query result is wrong", queryResult, returnQueryResult);
}