@Test public void shouldProcessListClientsAndReturnJson() throws Exception { final List<MemberInfo> expectedMembers = Arrays.asList( createMember("producer", null), createMember("producer", "subsystem")); GlobalConf.reload(new TestSuiteGlobalConf() { @Override public List<MemberInfo> getMembers(String... instanceIdentifier) { String[] instances = instanceIdentifier; assertThat("Wrong Xroad instance in query", instances, arrayContaining(EXPECTED_XR_INSTANCE)); return expectedMembers; } }); MetadataClientRequestProcessor processorToTest = new MetadataClientRequestProcessor(LIST_CLIENTS, mockJsonRequest, mockResponse); processorToTest.process(); assertContentTypeIsIn(Arrays.asList("application/json; charset=utf-8")); }
@Override public void process() throws Exception { switch (target) { case LIST_CLIENTS: handleListClients(); return; case LIST_CENTRAL_SERVICES: handleListCentralServices(); return; default: break; } }
MetadataClientRequestProcessor extends MessageProcessorBase { @Override public void process() throws Exception { switch (target) { case LIST_CLIENTS: handleListClients(); return; case LIST_CENTRAL_SERVICES: handleListCentralServices(); return; default: break; } } }
MetadataClientRequestProcessor extends MessageProcessorBase { @Override public void process() throws Exception { switch (target) { case LIST_CLIENTS: handleListClients(); return; case LIST_CENTRAL_SERVICES: handleListCentralServices(); return; default: break; } } MetadataClientRequestProcessor(String target,
            HttpServletRequest request, HttpServletResponse response); }
MetadataClientRequestProcessor extends MessageProcessorBase { @Override public void process() throws Exception { switch (target) { case LIST_CLIENTS: handleListClients(); return; case LIST_CENTRAL_SERVICES: handleListCentralServices(); return; default: break; } } MetadataClientRequestProcessor(String target,
            HttpServletRequest request, HttpServletResponse response); boolean canProcess(); @Override void process(); @Override MessageInfo createRequestMessageInfo(); }
MetadataClientRequestProcessor extends MessageProcessorBase { @Override public void process() throws Exception { switch (target) { case LIST_CLIENTS: handleListClients(); return; case LIST_CENTRAL_SERVICES: handleListCentralServices(); return; default: break; } } MetadataClientRequestProcessor(String target,
            HttpServletRequest request, HttpServletResponse response); boolean canProcess(); @Override void process(); @Override MessageInfo createRequestMessageInfo();  }