Repository: telstra/open-kilda
Issue: Incorrect error message if flow max_latency is higher than max_latency_tier2

**Steps to reproduce:**
1. Try to create flow by API `POST /v2/flows` where  flow max_latency is higher than max_latency_tier2

```
{
  "flow_id": "nik",
  "source": {
     "inner_vlan_id": 0,
    "port_number": 10,
    "switch_id": "00:00:00:22:3d:6b:00:7a",
    "vlan_id": 0
  },
  "destination": {
   "inner_vlan_id": 0,
    "port_number": 10,
    "switch_id": "00:00:00:22:3d:6c:00:40",
    "vlan_id": 0
  },
  "maximum_bandwidth": 1000,
  "max_latency": 200,
  "max_latency_tier2": 100
}
```

**Expected result:**
correct error message with latency in milliseconds 
`The maxLatency 200 is higher than maxLatencyTier2 100`

**Actual result:**
`"The maxLatency 200000000 is higher than maxLatencyTier2 100000000"`

Changed files:
src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtils.java
src-java/flowhs-topology/flowhs-storm-topology/src/test/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtilsTest.java

diff --git a/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtils.java b/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtils.java
index 02775742e..27b1fb07e 100644
--- a/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtils.java
+++ b/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtils.java
@@ -19,6 +19,8 @@ import static java.lang.String.format;
 
 import org.openkilda.messaging.error.ErrorType;
 
+import java.util.concurrent.TimeUnit;
+
 public final class ValidatorUtils {
 
     private ValidatorUtils() {}
@@ -40,9 +42,9 @@ public final class ValidatorUtils {
         }
         if (maxLatency > maxLatencyTier2) {
             throw new InvalidFlowException(
-                    format("The maxLatency %d is higher than maxLatencyTier2 %d",
-                            maxLatency,
-                            maxLatencyTier2),
+                    format("The maxLatency %dms is higher than maxLatencyTier2 %dms",
+                            TimeUnit.NANOSECONDS.toMillis(maxLatency),
+                            TimeUnit.NANOSECONDS.toMillis(maxLatencyTier2)),
                     ErrorType.DATA_INVALID);
         }
     }
diff --git a/src-java/flowhs-topology/flowhs-storm-topology/src/test/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtilsTest.java b/src-java/flowhs-topology/flowhs-storm-topology/src/test/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtilsTest.java
index 6f59cf997..29a07399a 100644
--- a/src-java/flowhs-topology/flowhs-storm-topology/src/test/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtilsTest.java
+++ b/src-java/flowhs-topology/flowhs-storm-topology/src/test/java/org/openkilda/wfm/topology/flowhs/validation/ValidatorUtilsTest.java
@@ -15,12 +15,40 @@
 
 package org.openkilda.wfm.topology.flowhs.validation;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
 import org.junit.Test;
 
 public class ValidatorUtilsTest {
+
     @Test
     public void maxLatencyValidatorMustAcceptEqualMaxLatencyAndMaxLatencyTier2() throws InvalidFlowException {
         // should not raise exception
         ValidatorUtils.maxLatencyValidator(500L, 500L);
     }
+
+    @Test
+    public void maxLatencyValidatorThrowsExceptionIfMaxLatencyTier2HigherThanMaxLatency() throws InvalidFlowException {
+        Exception exception = assertThrows(InvalidFlowException.class, () -> {
+            ValidatorUtils.maxLatencyValidator(60000000L, 50000000L);
+        });
+        assertThat(exception.getMessage(), equalTo("The maxLatency 60ms is higher than maxLatencyTier2 50ms"));
+    }
+
+    @Test
+    public void maxLatencyValidatorThrowsExceptionIfMaxLatencyNullAndMaxLatencyTier2Not() throws InvalidFlowException {
+        Exception exception = assertThrows(InvalidFlowException.class, () -> {
+            ValidatorUtils.maxLatencyValidator(null, 50000000L);
+        });
+        assertThat(exception.getMessage(), equalTo("maxLatencyTier2 property cannot be used without maxLatency"));
+    }
+
+    @Test
+    public void maxLatencyValidatorMustAcceptMaxLatencyExistAndMaxLatencyTier2IsNull() throws InvalidFlowException {
+        // should not raise exception
+        ValidatorUtils.maxLatencyValidator(500L, null);
+    }
+
 }