### Question:
JPQLSelectStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } JPQLSelectStatementBuilder(final JPQLContextView context); @Override JPQLStatement build();  }### Answer:
@Test public void testBuildSimpleQuery() throws EdmException, ODataJPARuntimeException { OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class); JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null); jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl); assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString()); }
@Test public void testBuildQueryWithOrderBy() throws EdmException, ODataJPARuntimeException { OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class); JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null); jpqlSelectContextImpl.setOrderByCollection("E1.soID ASC , E1.buyerId DESC"); jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl); assertEquals("SELECT E1 FROM SalesOrderHeader E1 ORDER BY E1.soID ASC , E1.buyerId DESC", jpqlSelectStatementBuilder.build().toString()); }
@Test public void testBuildQueryWithFilter() throws EdmException, ODataJPARuntimeException { OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class); FilterExpression filterExpression = null; JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, filterExpression); jpqlSelectContextImpl.setWhereExpression("E1.soID >= 1234"); jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl); assertEquals("SELECT E1 FROM SalesOrderHeader E1 WHERE E1.soID >= 1234", jpqlSelectStatementBuilder.build() .toString()); }