private static Map<String, String> getAvailableValues(String message, AuditLogable logable) { Map<String, String> returnValue = new HashMap<>(logable.getCustomValues()); Set<String> attributes = resolvePlaceHolders(message); if (attributes != null && attributes.size() > 0) { TypeCompat.getPropertyValues(logable, attributes, returnValue); } return returnValue; } }
@Test public void testGetAvailableValues() { setSomeValue("Anakin"); Map<String, String> values = new HashMap<>(); Set<String> properties = Collections.singleton("somevalue"); TypeCompat.getPropertyValues(this, properties, values); assertFalse(properties.isEmpty()); assertEquals("Anakin", values.get("somevalue"), "Standard"); }