@Test public void testSelectRequest_Sort_Group() { @SuppressWarnings("unchecked") MultivaluedMap<String, String> params = mock(MultivaluedMap.class); when(params.get("sort")).thenReturn( Collections.singletonList("[{\"property\":\"name\",\"direction\":\"DESC\"},{\"property\":\"address\",\"direction\":\"ASC\"}]")); when(params.get(SenchaParseRequestStage.GROUP)).thenReturn( Collections.singletonList("[{\"property\":\"id\",\"direction\":\"DESC\"},{\"property\":\"address\",\"direction\":\"ASC\"}]")); SelectContext<E2> context = prepareContext(params, E2.class); parseStage.doExecute(context); List<Sort> orderings = context.getMergedRequest().getOrderings(); assertEquals(4, orderings.size()); assertEquals("id", orderings.get(0).getProperty()); assertEquals(Dir.DESC, orderings.get(0).getDirection()); assertEquals("address", orderings.get(1).getProperty()); assertEquals(Dir.ASC, orderings.get(1).getDirection()); assertEquals("name", orderings.get(2).getProperty()); assertEquals(Dir.DESC, orderings.get(2).getDirection()); assertEquals("address", orderings.get(3).getProperty()); assertEquals(Dir.ASC, orderings.get(3).getDirection()); }
@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);   }