/** * Verifies that the actual VariableRecordValue's scopeInstanceKey is equal to the given one. * @param scopeInstanceKey the given scopeInstanceKey to compare the actual VariableRecordValue's scopeInstanceKey to. * @return this assertion object. * @throws AssertionError - if the actual VariableRecordValue's scopeInstanceKey is not equal to the given one. */ public S hasScopeInstanceKey(long scopeInstanceKey) { // check that actual VariableRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting scopeInstanceKey of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // check long actualScopeInstanceKey = actual.getScopeInstanceKey(); if (actualScopeInstanceKey != scopeInstanceKey) { failWithMessage(assertjErrorMessage, actual, scopeInstanceKey, actualScopeInstanceKey); } // return the current assertion for method chaining return myself; }
/** * Verifies that the actual VariableRecordValue's name is equal to the given one. * @param name the given name to compare the actual VariableRecordValue's name to. * @return this assertion object. * @throws AssertionError - if the actual VariableRecordValue's name is not equal to the given one. */ public S hasName(String name) { // check that actual VariableRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualName = actual.getName(); if (!Objects.areEqual(actualName, name)) { failWithMessage(assertjErrorMessage, actual, name, actualName); } // return the current assertion for method chaining return myself; }
/** * Verifies that the actual VariableRecordValue's value is equal to the given one. * @param value the given value to compare the actual VariableRecordValue's value to. * @return this assertion object. * @throws AssertionError - if the actual VariableRecordValue's value is not equal to the given one. */ public S hasValue(String value) { // check that actual VariableRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting value of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualValue = actual.getValue(); if (!Objects.areEqual(actualValue, value)) { failWithMessage(assertjErrorMessage, actual, value, actualValue); } // return the current assertion for method chaining return myself; }