001package tech.uom.lib.assertj.assertions; 002 003import javax.measure.Dimension; 004import org.assertj.core.api.AbstractObjectAssert; 005import org.assertj.core.util.Objects; 006 007/** 008 * Abstract base class for {@link Dimension} specific assertions - Generated by CustomAssertionGenerator. 009 */ 010@javax.annotation.Generated(value="assertj-assertions-generator") 011public abstract class AbstractDimensionAssert<S extends AbstractDimensionAssert<S, A>, A extends Dimension> extends AbstractObjectAssert<S, A> { 012 013 /** 014 * Creates a new <code>{@link AbstractDimensionAssert}</code> to make assertions on actual Dimension. 015 * @param actual the Dimension we want to make assertions on. 016 */ 017 protected AbstractDimensionAssert(A actual, Class<S> selfType) { 018 super(actual, selfType); 019 } 020 021 /** 022 * Verifies that the actual Dimension's baseDimensions is equal to the given one. 023 * @param baseDimensions the given baseDimensions to compare the actual Dimension's baseDimensions to. 024 * @return this assertion object. 025 * @throws AssertionError - if the actual Dimension's baseDimensions is not equal to the given one. 026 */ 027 public S hasBaseDimensions(java.util.Map baseDimensions) { 028 // check that actual Dimension we want to make assertions on is not null. 029 isNotNull(); 030 031 // overrides the default error message with a more explicit one 032 String assertjErrorMessage = "\nExpecting baseDimensions of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; 033 034 // null safe check 035 java.util.Map actualBaseDimensions = actual.getBaseDimensions(); 036 if (!Objects.areEqual(actualBaseDimensions, baseDimensions)) { 037 failWithMessage(assertjErrorMessage, actual, baseDimensions, actualBaseDimensions); 038 } 039 040 // return the current assertion for method chaining 041 return myself; 042 } 043 044}