Skip to content

twillouer/assertj-assertions-generator-idea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to the AssertJ assertions generator for IntelliJ IDEA project !

Overview

The Assertion Generator is able to create assertions specific to your own classes, it comes with :

Let's say that you have a Player class with name and team properties, the generator is able to create a PlayerAssert assertions class with hasName and hasTeam assertions, to write code like :

assertThat(mvp).hasName("Lebron James").hasTeam("Miami Heat");

Latest news

2013-03-26 : 1.0.0 release : the first release after Fest fork, generated assertions are cleaner.

Generate assertions from Maven

You should use the provided maven plugin.

Use with Eclipse

We have developed an Eclipse plugin that allows you to generate assertions for a specific class (one at time only).
Please check AssertJ eclipse plugin documentation.

Quickstart for NON Maven users

1 - Get AssertJ assertions generator

Get the AssertJ Assertions Generator 1.0.0 archive for unix or windows and extract it.

The archive structure is :

assertion-generator/
  |-- lib/
  |-- templates/
  |-- generate-assertions script (.bat or .sh)

2 - Generates assertions

  • Put in lib/ directory the jars containing the classes you want to generate assertions for .

  • Launch the scripts with either the classes or the packages containing the classes you want to generate assertions for.

Generate assertions for TolkienCharacter class :

generate-assertions.sh org.assertj.examples.data.TolkienCharacter 

Generate assertions for all classes in org.assertj.examples.data :

generate-assertions.sh org.assertj.examples.data 
  • your assertions classes have been generated, go find them in the current directory

Tip :
You can change what is generated by modifying the templates used for assertions creation (have a look at templates directory)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages