Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at joel.costigliola@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

The Assertions Generator can create specific assertions for your classes. It comes with :
* a CLI tool (this project)
* a [**maven plugin**](https://github.com/assertj/assertj-assertions-generator-maven-plugin).
* a [**maven plugin**](https://github.com/assertj/assertj-generator/tree/main/assertj-generator-maven-plugin).
* a [**gradle plugin**](https://github.com/assertj/assertj-generator-gradle-plugin).

Let's say you have a `Player` class with `name` and `team` properties. The generator will create a `PlayerAssert` assertions class with `hasName` and `hasTeam` assertions. This allows you to write :
Expand Down
60 changes: 60 additions & 0 deletions assertj-generator-maven-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Maven plugin to generate AssertJ assertions
==

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.assertj/assertj-assertions-generator-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.assertj/assertj-assertions-generator-maven-plugin)

## Overview

This plugin can generate [AssertJ assertions](https://github.com/joel-costigliola/assertj-core) for your own classes via maven (it is based on [assertj-assertions-generator](https://github.com/joel-costigliola/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 :

```java
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**](http://joel-costigliola.github.io/assertj/assertj-assertions-generator-maven-plugin.html), including a [**quickstart guide**](http://joel-costigliola.github.io/assertj/assertj-assertions-generator-maven-plugin.html#quickstart).
39 changes: 39 additions & 0 deletions assertj-generator-maven-plugin/javadoc-theme/assertj-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:root {
/* body, block and code fonts */
--body-font-family: Verdana, Geneva, sans-serif;
--block-font-family: Verdana, Geneva, serif;
/* Text colors for body and block elements */
--body-text-color: #000000;
--block-text-color: #000000;
/* Background colors for various elements */
--body-background-color: #edd9a6;
--detail-background-color: #edd9a6;
/* Colors for navigation bar and table captions */
--navbar-background-color: #232323;
--navbar-text-color: #edd9a6;
/* Background color for subnavigation and various headers */
--subnav-background-color: #e5c880;
--subnav-link-color: var(--link-color);
/* Background and text colors for selected tabs and navigation items */
--selected-background-color: #e5c880;
--selected-text-color: #000000;
--selected-link-color: #861203;
/* Background colors for generated tables */
--table-header-color: #e7ce8e;
--even-row-color: #edd9a6;
--odd-row-color: #e9d195;
/* Text color for page title */
--title-color: #000000;
/* Text colors for links */
--link-color: #861203;
--link-color-active: #641003;
/* Table of contents */
--toc-background-color: var(--body-background-color);
--toc-hover-color: #e9d195;
/* Snippet and pre colors */
--snippet-background-color: var(--body-background-color);
/* Border colors for structural elements and user defined tables */
--border-color: #e5c880;
/* Search input colors */
--search-input-background-color: #edd9a6;
}
108 changes: 108 additions & 0 deletions assertj-generator-maven-plugin/javadoc-theme/hljs-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*

Railscasts-like style (c) Visoft, Inc. (Damien White)

*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #232323;
color: #e6e1dc;
/* added by us */
border-radius:8px;
}

.hljs-comment,
.hljs-quote {
color: #bc9458;
font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag {
color: #c26230;
}

.hljs-string,
.hljs-number,
.hljs-regexp,
.hljs-variable,
.hljs-template-variable {
color: #a5c261;
}

.hljs-subst {
color: #519f50;
}

.hljs-tag,
.hljs-name {
color: #e8bf6a;
}

.hljs-type {
color: #ffc66d;
}


.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-attr,
.hljs-link {
color: #6d9cbe;
}

.hljs-params {
color: #d0d0ff;
}

.hljs-attribute {
color: #cda869;
}

.hljs-meta {
color: #9b859d;
}

.hljs-title,
.hljs-section {
color: #ffc66d;
}

.hljs-addition {
background-color: #144212;
color: #e6e1dc;
display: inline-block;
width: 100%;
}

.hljs-deletion {
background-color: #600;
color: #e6e1dc;
display: inline-block;
width: 100%;
}

.hljs-selector-class {
color: #9b703f;
}

.hljs-selector-id {
color: #8b98ab;
}

.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}

.hljs-link {
text-decoration: underline;
}
Loading