Assertj-Generator maven plugin custom variable

Viewed 14

I was wondering if there is a way to add a custom variable when using the assertj-assertions-generator-maven-plugin. I would like to introduce a variable in the maven pom that would be the entry point class name. What I have found in multi-module projects using the default EntryPointClass is that you end up with multiple classes called Assertions. This gets confusing if using test jars between modules in a project. What I have done in the past is have a custom assertionsEntryPointClass like the below. However, what I would really like is to be able to define a variable in the pom (say AssertionsEntryPointClassName) that I could use in the template.

Here is what I use today:

package ${package};

@javax.annotation.Generated(value="assertj-assertions-generator")
public class MyModuleAssertions {

${all_assertions_entry_points}

  protected MyModuleAssertions() {
    // empty
  }
}

What I would like to have would be this:

package ${package};

@javax.annotation.Generated(value="assertj-assertions-generator")
public class ${AssertionsEntryPointClassName}Assertions {

${all_assertions_entry_points}

  protected ${AssertionsEntryPointClassName}Assertions() {
    // empty
  }
}

0 Answers
Related