@Test public void testParseConsumer1() throws XRd4JException { String clientId = "FI_PILOT.GOV.0245437-2"; ConsumerEndpoint consumerEndpoint = new ConsumerEndpoint(null, clientId, null); assertEquals(true, ConsumerGatewayUtil.setConsumerMember(consumerEndpoint)); assertEquals(clientId, consumerEndpoint.getConsumer().toString()); assertEquals("FI_PILOT", consumerEndpoint.getConsumer().getXRoadInstance()); assertEquals("GOV", consumerEndpoint.getConsumer().getMemberClass()); assertEquals("0245437-2", consumerEndpoint.getConsumer().getMemberCode()); assertEquals(null, consumerEndpoint.getConsumer().getSubsystemCode()); clientId = "FI_PILOT.GOV.0245437-2.ConsumerService"; consumerEndpoint = new ConsumerEndpoint(null, clientId, null); assertEquals(true, ConsumerGatewayUtil.setConsumerMember(consumerEndpoint)); assertEquals(clientId, consumerEndpoint.getConsumer().toString()); assertEquals("FI_PILOT", consumerEndpoint.getConsumer().getXRoadInstance()); assertEquals("GOV", consumerEndpoint.getConsumer().getMemberClass()); assertEquals("0245437-2", consumerEndpoint.getConsumer().getMemberCode()); assertEquals("ConsumerService", consumerEndpoint.getConsumer().getSubsystemCode()); clientId = "FI_PILOT.GOV.0245437-2.ConsumerService.getOrganizationList"; consumerEndpoint = new ConsumerEndpoint(null, clientId, null); assertEquals(false, ConsumerGatewayUtil.setConsumerMember(consumerEndpoint)); clientId = "FI_PILOT.GOV.0245437-2.ConsumerService.getOrganizationList.v1"; consumerEndpoint = new ConsumerEndpoint(null, clientId, null); assertEquals(false, ConsumerGatewayUtil.setConsumerMember(consumerEndpoint)); clientId = "FI_PILOT.GOV"; consumerEndpoint = new ConsumerEndpoint(null, clientId, null); assertEquals(false, ConsumerGatewayUtil.setConsumerMember(consumerEndpoint)); }
protected static boolean setConsumerMember(ConsumerEndpoint endpoint) { ConsumerMember consumer = ConfigurationHelper.parseConsumerMember(endpoint.getClientId()); if (consumer == null) { log.warn("ConsumerMember not found."); return false; } endpoint.setConsumer(consumer); log.debug("ConsumerMember id : \"{}\".", consumer.toString()); return true; }
ConsumerGatewayUtil { protected static boolean setConsumerMember(ConsumerEndpoint endpoint) { ConsumerMember consumer = ConfigurationHelper.parseConsumerMember(endpoint.getClientId()); if (consumer == null) { log.warn("ConsumerMember not found."); return false; } endpoint.setConsumer(consumer); log.debug("ConsumerMember id : \"{}\".", consumer.toString()); return true; } }
ConsumerGatewayUtil { protected static boolean setConsumerMember(ConsumerEndpoint endpoint) { ConsumerMember consumer = ConfigurationHelper.parseConsumerMember(endpoint.getClientId()); if (consumer == null) { log.warn("ConsumerMember not found."); return false; } endpoint.setConsumer(consumer); log.debug("ConsumerMember id : \"{}\".", consumer.toString()); return true; } private  ConsumerGatewayUtil(); }
ConsumerGatewayUtil { protected static boolean setConsumerMember(ConsumerEndpoint endpoint) { ConsumerMember consumer = ConfigurationHelper.parseConsumerMember(endpoint.getClientId()); if (consumer == null) { log.warn("ConsumerMember not found."); return false; } endpoint.setConsumer(consumer); log.debug("ConsumerMember id : \"{}\".", consumer.toString()); return true; } private  ConsumerGatewayUtil(); static Map<String, ConsumerEndpoint> extractConsumers(Properties endpoints, Properties gatewayProperties); static void extractEndpoints(String key, Properties endpoints, ConsumerEndpoint endpoint); static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints); static String rewriteUrl(String servletUrl, String pathToResource, String responseStr); static ConsumerEndpoint createUnconfiguredEndpoint(Properties props, String pathToResource); static String removeResponseTag(String message); static boolean checkEncryptionProperties(Properties props, Map<String, ConsumerEndpoint> endpoints,
                                                    Map<String, Encrypter> asymmetricEncrypterCache); }
ConsumerGatewayUtil { protected static boolean setConsumerMember(ConsumerEndpoint endpoint) { ConsumerMember consumer = ConfigurationHelper.parseConsumerMember(endpoint.getClientId()); if (consumer == null) { log.warn("ConsumerMember not found."); return false; } endpoint.setConsumer(consumer); log.debug("ConsumerMember id : \"{}\".", consumer.toString()); return true; } private  ConsumerGatewayUtil(); static Map<String, ConsumerEndpoint> extractConsumers(Properties endpoints, Properties gatewayProperties); static void extractEndpoints(String key, Properties endpoints, ConsumerEndpoint endpoint); static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints); static String rewriteUrl(String servletUrl, String pathToResource, String responseStr); static ConsumerEndpoint createUnconfiguredEndpoint(Properties props, String pathToResource); static String removeResponseTag(String message); static boolean checkEncryptionProperties(Properties props, Map<String, ConsumerEndpoint> endpoints,
                                                    Map<String, Encrypter> asymmetricEncrypterCache);  }