GithubHelp home page GithubHelp logo

joel-costigliola / assertj Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 30.0 54.55 MB

AssertJ documentation

HTML 99.30% Shell 0.01% CSS 0.35% JavaScript 0.27% Python 0.01% Less 0.06% SCSS 0.02%
assertj documentation

assertj's People

Contributors

bananeweizen avatar croesch avatar eddarmitage avatar epeee avatar fbiville avatar filiphr avatar gaul avatar glae avatar hankem avatar joel-costigliola avatar jorgeviana avatar lesaint avatar libertylocked avatar melonhead901 avatar mwatts15 avatar pascalschumacher avatar regis1512 avatar riggs333 avatar szpak avatar tomekkaczanowski avatar vanroy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assertj's Issues

NumberAssertions in AbstractArrayAssert

Hi, I noticed that when I use extracting(), there are no NumberAssertions. I have numeric collections with ints and doubles and it would be very handy if I could do doesNotContainZero() or other numeric asserts.

Example:
assertThat(Collections.<BigInteger>emptyList()).extracting(BigInteger::intValue).doesNotContainZero()

Write an "How to edit assertj site" guide

Most of the pages of assertj.org are generated from simple template, to update the site one's must edit the template and generate the site instead of editing the generated pages.

Improved Java 8 stream support for flatExtracting?

Hi, at the moment I have this:

        assertThat(response.getSteps()).flatExtracting(input ->
                asList(input.getPeriod(),
                        input.getAmount(),
                        input.getNr())
        ).doesNotContain(0);

Would it be possible to support the following notations?
Like extracting():

.flatExtracting(
                Step::getPeriod,
                Step::getAmount,
                Step::getNr
        )

Or accept a stream like flatMap()?

.flatExtracting(
        Stream.of(input.getPeriod(),
                        input.getAmount(),
                        input.getNr())
        )

Document AssertJ non obvious behavior

Here's a non exhaustive list, feel free to add a comment to add items to this list.

  • navigation assertions limitation (not strongly typed)
  • Set assertions contains
  • ...

Better support comparing lists / iterable objects

There is new feature in 3.4.0 version:
assertThat(...).isEqualToComparingFieldByFieldRecursively(...)

but comparing lists is still poor, because we have to use equals(...) method when comparing two objects - it is used by default?

We would like to have methods like:

assertThat(<some iterable>).containsExactlyElementsOf(<some iterable>) - already provided.
assertThat(<some iterable>).containsExactlyElementsOfComparingFieldByField(<some iterable>) - really missing ๐Ÿ‘
assertThat(<some iterable>).containsExactlyElementsOfComparingFieldByFieldRecursively(<some iterable>) - missing too ๐Ÿ‘ ๐Ÿ‘ :)

BTW, if possible, I could do this.

Achieving auto-import of static methods in IDEA

In answer to: If someones know how to configure IntelliJ Idea to get Eclipse behavior for static import, please let me know, you can start typing assertThat and then invoke completion (Ctrl-Space) twice.

add "fork me on github" ribbon

The target link must change according to the actual page, for example if we are on Guava assertions page the ribbon link must point to assertj-guava.

Remove neo4j section?

The https://github.com/joel-costigliola/assertj-neo4j project has not been active for over two years. It only has seven stars on github. The examples of the assertj-examples project do not seem to work with the current neo4j release (3.0). Maybe it's time to remove the project from the assertj website or at least to mark it as unmaintained?

extracting() does not work with SoftAssertions

This test is failing:

import java.util.ArrayList;
import java.util.List;
import org.assertj.core.api.SoftAssertions;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
 *
 * @author Ivan (X-NoNAME) Kazakov
 * @mailto [email protected]
 */
public class AssertJTesting {

    private SoftAssertions s ;
    List<Humanoid> lva = new ArrayList<>();
    @BeforeMethod
    public void setUp(){
        s = new SoftAssertions();
        lva.add(new Humanoid("one", "oneone"));
        lva.add(new Humanoid("two", "twotwo"));
        lva.add(new Humanoid("three", "threethree"));
    }

    public static class Humanoid{
        private String name;
        private String namename;
        public Humanoid(String name, String namename) {
            this.name = name;
            this.namename = namename;
        }
    }

    @Test
    public void test_1(){
         s.assertThat(lva).extracting("name")
                 .contains("one")
                 .doesNotContain("oneone")
                .doesNotContainNull();
        s.assertAll();
    }

}

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.