Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Filter by
Sorted by
Tagged with
Filter by Employee ID
-1 votes
1 answer
65 views

How do you assert on a JSON list of objects with MockMvcTester? I want to cleanly map it to List<MyDto> and assert on that list. import com.example.em_card_service.data.dto.response....
-2 votes
2 answers
214 views

Suppose I need to softly assert against multiple object properties, one of which is a Mono. Typically, you use StepVerifier to assert against that. However, the verifyComplete() call will not be soft. ...
0 votes
0 answers
78 views

I have the following test with MockMvc: mockMvc.perform(get("/") .andExpect(xpath("//div[...]").string("...")); How can I use xpath with the new MockMvcTester ...
1 vote
1 answer
126 views

I'm currently working on a unit test for a kotlin function that will generate a csv file from some model data. I'm running into some strange test failures and the default output from assertJ isn't ...
0 votes
1 answer
74 views

I have set up a simple spring-boot app with schema.sql file and a JpaRepository for the Person entity class. I can verify that the schema is initialized and that the repository can write and read to ...
1 vote
0 answers
94 views

I have a proto message that includes a field for Tags: message Tags { map<string, bool> tagset = 1; } message Msg { Tags tags = 1; } I'm reading in a text proto file for unit testing. The ...
0 votes
0 answers
376 views

I'm currently trying to import the Assertj library into my Eclipse project to use the assertThat() assertion but I get an error when trying to import Assertj java library. import static org.assertj....
1 vote
1 answer
555 views

I'm trying to convert my MockMvc test to use the new MockMvcTester. Here is my current test code: mockMvc.perform(get("/api/persons")) .andExpect(status().isOk()) .andExpect(...
0 votes
1 answer
124 views

I am trying to extract a null field and assert it is null. However, assertJ reads the field as Boolean false instead of null. the field i am trying to extract is marked below. As you can see it is ...
0 votes
1 answer
77 views

I am using JUnitSoftAssertions and I like it so far. But sometimes, the click on call-to-action button takes longer than the next assertion, so it causes test failed. For example: @Rule public final ...
0 votes
1 answer
126 views

I'm working through a code example from the official Spring Academy course, specifically a test that deserializes JSON into a CashCard object using JacksonTester. Here's the relevant code snippet: ...
1 vote
3 answers
170 views

I have problem on assertJ comparison for the Child object that casted to Parent object. I just wanted to compare all the properties of the Parent object to the expected value object. Example class Dog ...
1 vote
1 answer
200 views

I'm testing that a class returns an instance of the same type modified in some way. After initializing the object I want to make verify that starting state. So for example: CLS cls = new CLS(a, b, c); ...
0 votes
1 answer
83 views

I need an overlay function around AssertJ extracting assertion. Its current implementation: import org.assertj.core.api.Assertions.assertThat import org.assertj.core.groups.Tuple fun <T, R> ...
1 vote
1 answer
78 views

I am having this test, junit assestion works well, while the same assertj assertion does not. @Test void registerWithDuplicatedEmail() throws EmailAlreadyRegistered { Mockito.when(customerCommand....

15 30 50 per page
1
2 3 4 5
28