@Test public void testUnknownOperation_CallExtension() throws ODataApplicationException { JPAArithmeticOperator operator = mock(JPAArithmeticOperatorImp.class); when(operator.getOperator()).thenReturn(BinaryOperatorKind.AND); when(extension.convert(operator)).thenThrow(new ODataApplicationException(null, HttpStatusCode.NOT_IMPLEMENTED .getStatusCode(), null)); try { cut.convert(operator); } catch (ODataApplicationException e) { assertEquals(HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), e.getStatusCode()); return; } fail("Exception expecetd"); }
public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator); @SuppressWarnings("unchecked") final Expression<T> convert(final JPAArithmeticOperator jpaOperator); final Expression<Boolean> convert(final JPABooleanOperatorImp jpaOperator); @SuppressWarnings({ "unchecked" }) final Expression<Boolean> convert(@SuppressWarnings("rawtypes") final JPAComparisonOperatorImp jpaOperator); @SuppressWarnings("unchecked") Expression<?> convert(final JPAMethodCall jpaFunction); final Expression<Boolean> convert(final JPAUnaryBooleanOperatorImp jpaOperator); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator); @SuppressWarnings("unchecked") final Expression<T> convert(final JPAArithmeticOperator jpaOperator); final Expression<Boolean> convert(final JPABooleanOperatorImp jpaOperator); @SuppressWarnings({ "unchecked" }) final Expression<Boolean> convert(@SuppressWarnings("rawtypes") final JPAComparisonOperatorImp jpaOperator); @SuppressWarnings("unchecked") Expression<?> convert(final JPAMethodCall jpaFunction); final Expression<Boolean> convert(final JPAUnaryBooleanOperatorImp jpaOperator);  }