Skip to content

Commit 6ac988e

Browse files
committed
ResourceVerifier
1 parent 3e3b002 commit 6ac988e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

management-model/src/main/java/org/jboss/hal/testsuite/model/ResourceVerifier.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ public ResourceVerifier verifyDoesNotExist() throws Exception {
122122
public ResourceVerifier verifyAttribute(String attributeName, ModelNode expectedValue, String errorMessageSuffix)
123123
throws Exception {
124124
ModelNode attributeValue = readAttribute(attributeName, errorMessageSuffix);
125-
assertEquals(expectedValue, attributeValue, "Attribute value is different in model! " + errorMessageSuffix);
125+
ModelNode normalizedExpected = normalizeNumericType(expectedValue, attributeValue);
126+
assertEquals(normalizedExpected, attributeValue, "Attribute value is different in model! " + errorMessageSuffix);
126127
return this;
127128
}
128129

@@ -681,6 +682,15 @@ private void waitFor(PropagationChecker checker) throws Exception {
681682
}
682683
}
683684

685+
private ModelNode normalizeNumericType(ModelNode expected, ModelNode actual) {
686+
ModelType expectedType = expected.getType();
687+
ModelType actualType = actual.getType();
688+
if (expectedType == ModelType.INT && actualType == ModelType.LONG) {
689+
return new ModelNode(expected.asLong());
690+
}
691+
return expected;
692+
}
693+
684694
@FunctionalInterface
685695
public interface PropagationChecker {
686696

0 commit comments

Comments
 (0)