You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/08/12 09:14:18 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6348: Improving code related to the Agent properties

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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org