Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Running assertj generator on JDK 11

Open
#128 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start by reproducing the maven-assertj-generator run on OpenJDK 11 using the generated MeldingAssert.hasReferenties method as the failing entry point. Review the generator, compile-testing and Guava build constraints mentioned in the report, then run the relevant JUnit Theories; done means the generated method compiles without the invalid interface token.

Written by the indexing model from the issue text.

Description

I am trying to build a library with OpenJDK 11 with the maven-assertj-generator plugin enabled. However, the plugin succeeds, but generates non-compiling code.

Has anyone had any succes on running the assertj-generator with OpenJDK 11?

Generated code:

/**
   * Verifies that the actual Melding's referenties contains the given interface Referentie elements.
   * @param referenties the given elements that should be contained in actual Melding's referenties.
   * @return this assertion object.
   * @throws AssertionError if the actual Melding's referenties does not contain all given interface Referentie elements.
   */
  public MeldingAssert hasReferenties(interface Referentie... referenties) {
    // check that actual Melding we want to make assertions on is not null.
    isNotNull();

    // check that given interface Referentie varargs is not null.
    if (referenties == null) failWithMessage("Expecting referenties parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getReferenties(), referenties);

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

Wrong line:
public MeldingAssert hasReferenties(interface Referentie... referenties) {
Expected line:
public MeldingAssert hasReferenties(Referentie... referenties) {

To solve the issue, I tried building the assertj-assertions-generator on OpenJDK 11, but I also ran into all kinds of trouble.

  • Tried to build a latest version of com.google.testing.compile:compile-testing
  • Tried to upgrade Guava
  • Needed to upgrade to JDK 8 source code
  • Ran into troubles running JUnit Theories
Dominant language
Java
Stars
72
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assertj/assertj-generator

All issues in assertj/assertj-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.