test_class.declarator: response = new AtomicReference<>()
test_class.modifier: private final
test_class.original_string: private final AtomicReference<List<ConsulNode>> response = new AtomicReference<>();
test_class.type: AtomicReference<List<ConsulNode>>
test_class.var_name: response
test_class.declarator: TYPE_TOKEN = new TypeToken<List<ConsulNode>>() {
      }
test_class.modifier: private static final
test_class.original_string: private static final TypeToken<List<ConsulNode>> TYPE_TOKEN = new TypeToken<List<ConsulNode>>() {
      };
test_class.type: TypeToken<List<ConsulNode>>
test_class.var_name: TYPE_TOKEN
test_class.file: config/consul/src/test/java/org/microbule/config/consul/ConsulConfigProviderTest.java
test_class.identifier: ConsulConfigProviderTest
test_class.superclass: extends JaxrsServerTestCase<MockConsulService>
test_case.body: @Test
      public void testGetConfig() {
          final ConsulConfigProvider provider = new ConsulConfigProvider();
          assertEquals("consul", provider.name());
          assertEquals(ConfigUtils.PRIORITY_EXTERNAL, provider.priority());
  
          response.set(parseResponse("/response.json", TYPE_TOKEN));
  
          final Config config = provider.getConfig("one", "two");
          assertEquals("Microbule", config.value("three").get());
          assertEquals("three, sir", config.value("five").get());
  
      }
test_case.class_method_signature: ConsulConfigProviderTest.testGetConfig()
test_case.full_signature: @Test public void testGetConfig()
test_case.identifier: testGetConfig
test_case.invocations: assertEquals name assertEquals priority set parseResponse getConfig assertEquals get value assertEquals get value
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetConfig()
focal_class.declarator: RECURSE_PARAM = "recurse"
focal_class.modifier: private static final
focal_class.original_string: private static final String RECURSE_PARAM = "recurse";
focal_class.type: String
focal_class.var_name: RECURSE_PARAM
focal_class.declarator: SEPARATOR = "/"
focal_class.modifier: private static final
focal_class.original_string: private static final String SEPARATOR = "/";
focal_class.type: String
focal_class.var_name: SEPARATOR
focal_class.declarator: DEFAULT_BASE_ADDRESS = "http://localhost:8500/v1/kv/microbule"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_BASE_ADDRESS = "http://localhost:8500/v1/kv/microbule";
focal_class.type: String
focal_class.var_name: DEFAULT_BASE_ADDRESS
focal_class.declarator: BASE_ADDRESS_PROP = "baseAddress"
focal_class.modifier: private static final
focal_class.original_string: private static final String BASE_ADDRESS_PROP = "baseAddress";
focal_class.type: String
focal_class.var_name: BASE_ADDRESS_PROP
focal_class.declarator: NAME = "consul"
focal_class.modifier: private static final
focal_class.original_string: private static final String NAME = "consul";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: TYPE_TOKEN = new TypeToken<List<ConsulNode>>() {
      }
focal_class.modifier: private static final
focal_class.original_string: private static final TypeToken<List<ConsulNode>> TYPE_TOKEN = new TypeToken<List<ConsulNode>>() {
      };
focal_class.type: TypeToken<List<ConsulNode>>
focal_class.var_name: TYPE_TOKEN
focal_class.declarator: baseTarget
focal_class.modifier: private final
focal_class.original_string: private final WebTarget baseTarget;
focal_class.type: WebTarget
focal_class.var_name: baseTarget
focal_class.file: config/consul/src/main/java/org/microbule/config/consul/ConsulConfigProvider.java
focal_class.identifier: ConsulConfigProvider
focal_class.interfaces: implements ConfigProvider
focal_class.class_method_signature: ConsulConfigProvider.ConsulConfigProvider()
focal_class.full_signature: public  ConsulConfigProvider()
focal_class.identifier: ConsulConfigProvider
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ConsulConfigProvider()
focal_class.class_method_signature: ConsulConfigProvider.ConsulConfigProvider(String baseAddress)
focal_class.full_signature: public  ConsulConfigProvider(String baseAddress)
focal_class.identifier: ConsulConfigProvider
focal_class.modifiers: public
focal_class.parameters: (String baseAddress)
focal_class.signature:  ConsulConfigProvider(String baseAddress)
focal_class.class_method_signature: ConsulConfigProvider.getConfig(String... path)
focal_class.full_signature: @Override public Config getConfig(String... path)
focal_class.identifier: getConfig
focal_class.modifiers: @Override public
focal_class.parameters: (String... path)
focal_class.return: Config
focal_class.signature: Config getConfig(String... path)
focal_class.class_method_signature: ConsulConfigProvider.name()
focal_class.full_signature: @Override public String name()
focal_class.identifier: name
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String name()
focal_class.class_method_signature: ConsulConfigProvider.priority()
focal_class.full_signature: @Override public int priority()
focal_class.identifier: priority
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int priority()
focal_class.class_method_signature: ConsulConfigProvider.base64Decode(String value)
focal_class.full_signature: private String base64Decode(String value)
focal_class.identifier: base64Decode
focal_class.modifiers: private
focal_class.parameters: (String value)
focal_class.return: String
focal_class.signature: String base64Decode(String value)
focal_method.body: @Override
      public Config getConfig(String... path) {
          final Response response = extend(baseTarget, path).queryParam(RECURSE_PARAM, Boolean.TRUE).request(MediaType.APPLICATION_JSON_TYPE).get();
          final String keyPath = Stream.of(path).collect(Collectors.joining(SEPARATOR)) + SEPARATOR;
          return WebTargetUtils.parseJsonResponse(response, TYPE_TOKEN)
                  .map(nodes -> nodes.stream().collect(Collectors.toMap(node -> StringUtils.substringAfter(node.getKey(), keyPath), node -> base64Decode(node.getValue()))))
                  .map(map -> (Config)new MapConfig(map, SEPARATOR))
                  .orElse(EmptyConfig.INSTANCE);
      }
focal_method.class_method_signature: ConsulConfigProvider.getConfig(String... path)
focal_method.full_signature: @Override public Config getConfig(String... path)
focal_method.identifier: getConfig
focal_method.invocations: get request queryParam extend collect of joining orElse map map parseJsonResponse collect stream toMap substringAfter getKey base64Decode getValue
focal_method.modifiers: @Override public
focal_method.parameters: (String... path)
focal_method.return: Config
focal_method.signature: Config getConfig(String... path)