question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add extracting()/returns() method to most assertions

See original GitHub issue

Feature summary

when testing a spring-data-jpa application, I found org.assertj.core.api.Assertions.assertThat(org.springframework.data.domain.Page) returns IterableAssert which has no extracting() and returns() method.

I have to use org.assertj.core.api.Assertions#assertThatObject.

In Java world, Iterable implement instances are all expected to be Object, so can we add method extracting and returns (maybe some more) functions to IterableAssert? It should make writing unittest more easy.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fishautumncommented, Aug 2, 2022

All my questions are get answered. Thanks for all of your reponse.

0reactions
joel-costigliolacommented, Aug 2, 2022

@fishautumn is there anything else you need from us or can we close this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extracting function from entries for Map · Issue #1370 - GitHub
Summary I like very much the extracting function feature of AssertJ. With Iterable objects, it is really fine as that is defined in...
Read more >
AssertJ / Fluent assertions for java
Like extracting but instead of extracting properties/fields, it extracts the result of a given method invocation on the elements of the Iterable/Array under ......
Read more >
AssertJ: Retrieving First Items From Extracting List Returns List ...
extracting for Object assertion extracts the object under test (here asia ) properties resulting in a List of extracted property values.
Read more >
Asserting Lists with AssertJ - Reflectoring
How can we extract certain elements out of a list to assert them? This article shows how to work with lists in AssertJ....
Read more >
Testing Java Collections with AssertJ. - Medium
Let's dive into fluent assertions java library “AssertJ”, that can make your life easier and your tests more reliable and readable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found