Merge "Keep case in MdnsServiceInfo attributes"

This commit is contained in:
Remi NGUYEN VAN
2023-03-06 13:03:46 +00:00
committed by Gerrit Code Review
2 changed files with 26 additions and 9 deletions

View File

@@ -118,6 +118,26 @@ public class MdnsServiceInfoTest {
info.getAttributes());
}
@Test
public void constructor_createWithUppercaseKeys_correctAttributes() {
MdnsServiceInfo info =
new MdnsServiceInfo(
"my-mdns-service",
new String[] {"_testtype", "_tcp"},
List.of(),
new String[] {"my-host", "local"},
12345,
"192.168.1.1",
"2001::1",
List.of("KEY=Value"),
/* textEntries= */ null);
assertEquals("Value", info.getAttributeByKey("key"));
assertEquals("Value", info.getAttributeByKey("KEY"));
assertEquals(1, info.getAttributes().size());
assertEquals("KEY", info.getAttributes().keySet().iterator().next());
}
@Test
public void getInterfaceIndex_constructorWithDefaultValues_returnsMinusOne() {
MdnsServiceInfo info =