DaanHoogland commented on code in PR #6348:
URL: https://github.com/apache/cloudstack/pull/6348#discussion_r944270970


##########
agent/src/test/java/com/cloud/agent/AgentShellTest.java:
##########
@@ -59,4 +84,290 @@ public void testGetHost() {
         }
         Assert.assertEquals(shell.getNextHost(), hosts.get(0));
     }
+
+    @Test
+    public void isValueStartingAndEndingWithAtSignTestValues() {
+        Map<String, Boolean> valuesAndExpects = new HashMap<>();
+        valuesAndExpects.put("@test@", true);
+        valuesAndExpects.put("test@", false);
+        valuesAndExpects.put("@test", false);
+        valuesAndExpects.put("test", false);
+        valuesAndExpects.put("te@st", false);
+
+        valuesAndExpects.forEach((value, expected) -> {
+            boolean result = 
agentShellSpy.isValueStartingAndEndingWithAtSign(value);
+            if (expected != result) {
+                throw new AssertionError(String.format("Test with value [%s] 
does not returned as expected. Expected: [%s], Result: [%s].", value, expected, 
result));
+            }

Review Comment:
   ```suggestion
               assertEquals(String.format("Test with value [%s] does not return 
as expected.ยจ, value), expected, result);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to