@Test public void testPutUserAgentAttributes() throws Exception { ObjectNode metadata = mapToObjectNode(ImmutableMap.of("user_agent", ImmutableMap.of("browser", "Firefox", "version", "63.0", "os", "Macintosh"))); Map<String, String> expected = ImmutableMap.of("user_agent_browser", "Firefox", "user_agent_version", "63.0", "user_agent_os", "Macintosh"); Map<String, String> attributes = new HashMap<>(); NestedMetadata.putUserAgentAttributes(attributes, metadata); assertEquals(expected, attributes); }
static void putUserAgentAttributes(Map<String, String> attributes, ObjectNode metadata) { putAttributes(attributes, metadata, Attribute.USER_AGENT, USER_AGENT_PREFIX); }
NestedMetadata { static void putUserAgentAttributes(Map<String, String> attributes, ObjectNode metadata) { putAttributes(attributes, metadata, Attribute.USER_AGENT, USER_AGENT_PREFIX); } }
NestedMetadata { static void putUserAgentAttributes(Map<String, String> attributes, ObjectNode metadata) { putAttributes(attributes, metadata, Attribute.USER_AGENT, USER_AGENT_PREFIX); } private  NestedMetadata(); }
NestedMetadata { static void putUserAgentAttributes(Map<String, String> attributes, ObjectNode metadata) { putAttributes(attributes, metadata, Attribute.USER_AGENT, USER_AGENT_PREFIX); } private  NestedMetadata(); static byte[] mergedPayload(byte[] payload, byte[] metadata); static ObjectNode attributesToMetadataPayload(Map<String, String> attributes); static void stripPayloadMetadataToAttributes(Map<String, String> attributes,
      ObjectNode payload); }
NestedMetadata { static void putUserAgentAttributes(Map<String, String> attributes, ObjectNode metadata) { putAttributes(attributes, metadata, Attribute.USER_AGENT, USER_AGENT_PREFIX); } private  NestedMetadata(); static byte[] mergedPayload(byte[] payload, byte[] metadata); static ObjectNode attributesToMetadataPayload(Map<String, String> attributes); static void stripPayloadMetadataToAttributes(Map<String, String> attributes,
      ObjectNode payload);  }