Giter VIP home page Giter VIP logo

assertj-assertions-generator-maven-plugin's Introduction

Maven plugin to generate AssertJ assertions

Overview

This plugin can generate AssertJ assertions for your own classes via maven (it is based on assertj-assertions-generator).

Let's say that you have a Player class with name and team attributes, the plugin 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");

The plugin can be launched with command mvn generate-test-sources (or simply mvn test) or with any IDE that supports maven. By default, it generates the assertions source files in target/generated-test-sources/assertions as per maven convention (but this can be changed - see below).

Example of plugin execution:

====================================
AssertJ assertions generation report
====================================

--- Generator input parameters ---

Generating AssertJ assertions for classes in following packages and subpackages:
- org.assertj.examples.data

--- Generator results ---

Directory where custom assertions files have been generated :
- /home/joe/assertj/assertj-examples/target/generated-test-sources/assertj-assertions

Custom assertions files generated :
- TeamAssert.java
- BasketBallPlayerAssert.java
- EmployeeAssert.java
- NameAssert.java
- MagicalAssert.java
- PersonAssert.java
- RaceAssert.java
- GameServiceAssert.java
- MansionAssert.java
- TitleAssert.java
- AlignmentAssert.java
- TolkienCharacterAssert.java
- RingAssert.java
- MovieAssert.java
- TeamManagerAssert.java

Assertions entry point class has been generated in file:
- /home/joe/assertj/assertj-examples/target/generated-test-sources/assertj-assertions/org/assertj/examples/data/Assertions.java

Documentation

Please have a look at the complete documentation in assertj.org assertions generator section, including a quickstart guide.

assertj-assertions-generator-maven-plugin's People

Contributors

glhez avatar jcgay avatar joel-costigliola avatar martinlau avatar mostr avatar pascalschumacher avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.