@Test
public void testTransform() {

    // Fill the three parts of a config document
    String[][] transforms = {
            {"str","message"},
            {"str", "place.loc"},
            {"str","invalid","nope"},
            {"str"}
    };
    List<List> transformations = new ArrayList<>();
    for (String[] t : transforms) {
        List list = new ArrayList(Arrays.asList(t));
        transformations.add(list);
    }
    outgoing.put("transformations", transformations);
    // Create the UUT
    pHandler = new UDPPublishHandler(outgoing, fakeSocket, sourceName);
    // Create sample data
    String expectedAddress = "127.0.0.1";
    int expectedPort = port;
    Map<String,Object> testMap = new LinkedHashMap<>();
    testMap.put("str", "msg");
    // Manage expectations
    Map<String,Object> expectedData = new LinkedHashMap<>();
    Map<String,Object> subMap = new LinkedHashMap<>();
    subMap.put("loc","msg");
    expectedData.put("place",subMap);
    expectedData.put("message","msg");
    // Test UUT
    createMessage(testMap);
    pHandler.handleMessage(extMsg);
    assert fakeSocket.compareData(expectedData);
    assert fakeSocket.compareAddress(expectedAddress);
    assert fakeSocket.comparePort(expectedPort);
}