Code review comment: We can have a local variable or a constant for the sending text instead of repeating it

Code under review:
public void testMetrics() throws Exception {
        WebSocketTestClient client = new WebSocketTestClient("ws:
        client.handshake();
        client.sendText("ds");
        client.sendText("ds");
        client.sendText("ds");
        client.sendText("ds");
        client.sendText("ds");
        client.sendPing(SENDING_BYTE_BUFFER);
        client.sendPong(SENDING_BYTE_BUFFER);
        client.sendBinary(SENDING_BYTE_BUFFER);
        client.sendText("closeMe");
        client.shutDown();

        URL metricsEndPoint = new URL("http:
        BufferedReader reader = new BufferedReader(new InputStreamReader(metricsEndPoint.openConnection()
                .getInputStream()));
        List<String> metricsList = reader.lines().filter(s -> !s.startsWith("
        Assert.assertTrue(metricsList.size() != 0);
        int count = 0;
        for (String line : metricsList) {
            int index = line.lastIndexOf(" ");
            String key = line.substring(0, index);
            String value = line.substring(index + 1);
            String metric = getMetricName(key);
            String connectionID = getTag(key, "connectionID");
            String clientOrServer = getTag(key, "client_or_server");
            String service = getTag(key, "service");
            String type = getTag(key, "type");
            String[] tags = {connectionID, clientOrServer, service, type};
            key = generateNewKey(metric, tags);
            key = key.replaceAll("connectionID=\"[^\"]*\",", "connectionID=connection_id,");
            String actualValue = expectedMetrics.get(key);
            if (actualValue != null) {
                count++;
                logger.info(key + " -- " + value);
                Assert.assertEquals(value, actualValue, "Unexpected value found for metric " + key + ".");
            }
        }
        Assert.assertEquals(count, expectedMetrics.size(), "metrics count is not equal to the expected metrics count.");
        reader.close();
    }

Line commented on: client.sendText("ds");

Revised code:
public void testMetrics() throws Exception {
        WebSocketTestClient client = new WebSocketTestClient("ws:
        client.handshake();
        client.sendText(MESSAGE);
        client.sendText(MESSAGE);
        client.sendText(MESSAGE);
        client.sendText(MESSAGE);
        client.sendText(MESSAGE);
        client.sendPing(SENDING_BYTE_BUFFER);
        client.sendPong(SENDING_BYTE_BUFFER);
        client.sendBinary(SENDING_BYTE_BUFFER);
        client.sendText(CLOSE_MESSAGE);
        CountDownLatch countDownLatch = new CountDownLatch(1);
        countDownLatch.await(10, TimeUnit.SECONDS);
        client.shutDown();

        URL metricsEndPoint = new URL("http:
        BufferedReader reader = new BufferedReader(new InputStreamReader(metricsEndPoint.openConnection()
                .getInputStream()));
        List<String> metricsList = reader.lines().filter(s -> !s.startsWith("
        Assert.assertTrue(metricsList.size() != 0);
        int count = 0;
        for (String line : metricsList) {
            int index = line.lastIndexOf(" ");
            String key = line.substring(0, index);
            String value = line.substring(index + 1);
            String metric = getMetricName(key);
            String connectionID = getTag(key, WebSocketObservabilityConstants.TAG_CONNECTION_ID);
            String clientOrServer = getTag(key, WebSocketObservabilityConstants.TAG_CONTEXT);
            String service = getTag(key, WebSocketObservabilityConstants.TAG_SERVICE);
            String type = getTag(key, WebSocketObservabilityConstants.TAG_MESSAGE_TYPE);
            String[] tags = {connectionID, clientOrServer, service, type};
            key = generateNewKey(metric, tags);
            String actualValue = expectedMetrics.get(key);
            if (actualValue != null) {
                count++;
                logger.info(key + " -- " + value);
                Assert.assertEquals(value, actualValue, "Unexpected value found for metric " + key + ".");
            }
        }
        Assert.assertEquals(count, expectedMetrics.size(), "metrics count is not equal to the expected metrics count.");
        reader.close();
    }