@Test public void testSelectRequest_Filter() { @SuppressWarnings("unchecked") MultivaluedMap<String, String> params = mock(MultivaluedMap.class); when(params.get(SenchaParseRequestStage.FILTER)).thenReturn(Collections.singletonList("[{\"property\":\"name\",\"value\":\"xyz\"}]")); SelectContext<E2> context = prepareContext(params, E2.class); parseStage.doExecute(context); SenchaRequest senchaRequest = SenchaRequest.get(context); assertNotNull(senchaRequest); assertFalse(senchaRequest.getFilters().isEmpty()); assertEquals("name", senchaRequest.getFilters().get(0).getProperty()); assertEquals("xyz", senchaRequest.getFilters().get(0).getValue()); assertEquals("like", senchaRequest.getFilters().get(0).getOperator()); }
@Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); SenchaRequest.Builder builder = SenchaRequest.builder() .filters(filterParser.fromString(ParameterExtractor.string(protocolParameters, FILTER))); SenchaRequest.set(context, builder.build()); }
SenchaParseRequestStage extends ParseRequestStage { @Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); SenchaRequest.Builder builder = SenchaRequest.builder() .filters(filterParser.fromString(ParameterExtractor.string(protocolParameters, FILTER))); SenchaRequest.set(context, builder.build()); } }
SenchaParseRequestStage extends ParseRequestStage { @Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); SenchaRequest.Builder builder = SenchaRequest.builder() .filters(filterParser.fromString(ParameterExtractor.string(protocolParameters, FILTER))); SenchaRequest.set(context, builder.build()); } SenchaParseRequestStage(
            @Inject IAgRequestBuilderFactory requestBuilderFactory,
            @Inject ISenchaFilterParser filterParser); }
SenchaParseRequestStage extends ParseRequestStage { @Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); SenchaRequest.Builder builder = SenchaRequest.builder() .filters(filterParser.fromString(ParameterExtractor.string(protocolParameters, FILTER))); SenchaRequest.set(context, builder.build()); } SenchaParseRequestStage(
            @Inject IAgRequestBuilderFactory requestBuilderFactory,
            @Inject ISenchaFilterParser filterParser);  }
SenchaParseRequestStage extends ParseRequestStage { @Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); SenchaRequest.Builder builder = SenchaRequest.builder() .filters(filterParser.fromString(ParameterExtractor.string(protocolParameters, FILTER))); SenchaRequest.set(context, builder.build()); } SenchaParseRequestStage(
            @Inject IAgRequestBuilderFactory requestBuilderFactory,
            @Inject ISenchaFilterParser filterParser);   }