assertj-assertions-generator icon indicating copy to clipboard operation
assertj-assertions-generator copied to clipboard

Add @see tags to methods to point back to the original member

Open Nava2 opened this issue 8 years ago • 3 comments

It'd be helpful if generated methods included an @see to the member the value was generated from.

Example

Given

class Foo {
  public int getBar() {
    return 0;
  }
}

Actual

  /**
   * Verifies that the actual Foo's bar is equal to the given one.
   * @param bar the given bar to compare the actual Foo's bar to.
   * @return this assertion object.
   * @throws AssertionError - if the actual Foo's bar is not equal to the given one.
   */
  public FooAssert hasBar(int bar) {
    // ... cut for brevity ...
    return this;
  }

Expected

  /**
   * Verifies that the actual Foo's bar is equal to the given one.
   * @param bar the given bar to compare the actual Foo's bar to.
   * @return this assertion object.
   * @throws AssertionError - if the actual Foo's bar is not equal to the given one.
   * @see Foo#getBar() Member under test.
   */
  public FooAssert hasBar(int bar) {
    // ... cut for brevity ...
    return this;
  }

Nava2 avatar May 26 '17 01:05 Nava2

it is possible but isn't that obvious from the assertion method name ? what is the problem/pain you are trying to address by adding the @see tag ?

joel-costigliola avatar May 26 '17 01:05 joel-costigliola

When working in an IDE it's handy to be able to follow the links! 🙂

Nava2 avatar May 26 '17 02:05 Nava2

fair enough

joel-costigliola avatar May 26 '17 02:05 joel-costigliola