Skip to content

Conversation

@agoerler
Copy link
Contributor

@agoerler agoerler commented Jan 7, 2026

No description provided.

CqnInsert insert = Insert.into(TRAVELS).entry(travel);

assertThatExceptionOfType(ServiceException.class)
.isThrownBy(() -> srv.run(insert)).satisfies(badRequest("Customer does not exist", "Customer_ID"));
Copy link
Contributor Author

@agoerler agoerler Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beckermarc, @StefanHenke - why is the target here Customer_ID but on line 65 it's Customer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only assert the service exception. There are additional error messages in the messages bag. There you will find additional errors for Customer_ID for both variants the error message from @mandatory and the one from the @assert annotation. I think we should avoid this double duplication.

  1. Either we use the @Assert or the @mandatory to check for null
  2. We should annotate the foreign key Customer.ID instead of Customer to avoid duplicating the annotations across association and foreign key.

@agoerler agoerler merged commit b94151f into main Jan 9, 2026
6 checks passed
@agoerler agoerler deleted the constraintTests branch January 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants