All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.zeebe.protocol.record.intent.AbstractProcessIntentAssert Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha7
Show newest version
package io.zeebe.protocol.record.intent;

import org.assertj.core.api.AbstractComparableAssert;

/**
 * Abstract base class for {@link ProcessIntent} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractProcessIntentAssert, A extends ProcessIntent> extends AbstractComparableAssert {

  /**
   * Creates a new {@link AbstractProcessIntentAssert} to make assertions on actual ProcessIntent.
   * @param actual the ProcessIntent we want to make assertions on.
   */
  protected AbstractProcessIntentAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  /**
   * Verifies that the actual ProcessIntent's intent is equal to the given one.
   * @param intent the given intent to compare the actual ProcessIntent's intent to.
   * @return this assertion object.
   * @throws AssertionError - if the actual ProcessIntent's intent is not equal to the given one.
   */
  public S hasIntent(short intent) {
    // check that actual ProcessIntent we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting intent of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // check
    short actualIntent = actual.getIntent();
    if (actualIntent != intent) {
      failWithMessage(assertjErrorMessage, actual, intent, actualIntent);
    }

    // return the current assertion for method chaining
    return myself;
  }

}