@Test
public void testCorrectUdpEchoResponseWithAdditionalWhiteSpace (@Mocked final DatagramSocket mock, @Mocked final InetAddress inetAddress) throws Exception {

    new Expectations() {{
        // spoof the internet address (as we WILL get an UnknownHostException otherwise)
        InetAddress.getByName(anyString);
        result = toReturn;  //return loopback address
        // check the sent data for correctness, when send is called
        mock.send((DatagramPacket) any);
        result = new Delegate() {
            void delegateMethod(DatagramPacket packet) {
                sendPacket = packet;
            }
        };
        //return the correct message
        mock.receive((DatagramPacket) any);
        result = new Delegate() {
            void delegateMethod(DatagramPacket packet) {
                packet.setData(WRONG_MESSAGE_ADDITIONAL_WHITESPACE.getBytes());
            }
        };
    }};
    final EchoProtocolUdpTask task = new EchoProtocolUdpTask(qosTest, clientHolder.getTaskDescList().get(0), 0);
    final QoSTestResult res = task.call();
    assertEquals("Payload sent to server != " + CORRECT_MESSAGE, CORRECT_MESSAGE, new String(sendPacket.getData()));
    assertEquals("Result did not return ERROR","ERROR", res.getResultMap().get(AbstractEchoProtocolTask.RESULT_STATUS));
    assertEquals("Wrong echo service host in result", ECHO_SERVICE_HOST, res.getResultMap().get("echo_protocol_objective_host"));
    assertEquals("Wrong protocol type in result", AbstractEchoProtocolTask.PROTOCOL_UDP, res.getResultMap().get(AbstractEchoProtocolTask.RESULT_PROTOCOL));
    assertEquals("Payload stored in result !=" + WRONG_MESSAGE_ADDITIONAL_WHITESPACE, WRONG_MESSAGE_ADDITIONAL_WHITESPACE, res.getResultMap().get(AbstractEchoProtocolTask.RESULT));
}