PropertyController implements Controller { String properties() { var builder = new StringBuilder(32768); builder.append("# properties\n"); for (String key : new TreeSet<>(propertyManager.properties.keys())) { String value = propertyManager.property(key).orElse(""); builder.append(key).append('=').append(mask(key, value)).append('\n'); } builder.append("\n# system properties\n"); Properties properties = System.getProperties(); for (var key : new TreeSet<>(properties.stringPropertyNames())) { String value = properties.getProperty(key); String maskedValue = mask(key, value); builder.append(key).append('=').append(maskedValue).append('\n'); } builder.append("\n# env variables\n"); Map<String, String> env = new TreeMap<>(System.getenv()); for (Map.Entry<String, String> entry : env.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); builder.append(key).append('=').append(mask(key, value)).append('\n'); } return builder.toString(); } PropertyController(PropertyManager propertyManager); @Override Response execute(Request request);  }
@Test void properties() { propertyManager.properties.set("sys.jdbc.user", "user"); propertyManager.properties.set("sys.jdbc.password", "password"); assertThat(controller.properties()) .contains("sys.jdbc.password=******") .contains("sys.jdbc.user=user"); }