Skip to content

Conversation

@leafdevelop-ch
Copy link
Contributor

JIRA link

Change description

Work checklist

  • Bug fix
  • New feature
  • Breaking change
  • Infrastructure change

Pull request checklist

  • I have added unit tests for new code that I have added
  • I have added/updated functional tests where appropriate
  • The code follows our coding standards

An exhaustive list of peer review checks can be read here

Merge instructions

We are committed to keeping commit history clean, consistent and linear. To achieve this commit should be structured as follows:

<type>[optional scope]: <description>

and contain the following structural elements:

  • fix: a commit that patches a bug in your codebase (this correlates with PATCH in semantic versioning),
  • feat: a commit that introduces a new feature to the codebase (this correlates with MINOR in semantic versioning),
  • BREAKING CHANGE: a commit that has a footer BREAKING CHANGE: introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type,
  • types other than fix: and feat: are allowed, for example build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others,
  • footers other than BREAKING CHANGE: <description> may be provided.

@leafdevelop-ch leafdevelop-ch force-pushed the simplify-validation-test-example branch from 9f13851 to 4087df9 Compare July 4, 2025 10:45
PartnershipType partnershipType = limitedPartnershipDto.getData().getPartnershipType();

String contributionCurrencyValue = limitedPartnerDataDto.getContributionCurrencyValue();
String contributionCurrencyValue = limitedPartnerDataDto.getContributionCurrencyValue().toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore... just to get it to compile

import org.springframework.validation.Validator;

@SpringBootTest
class LimitedPartnerDataDtoValidationTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idea based on what was spoke about in dev meeting yesterday. Simplify test for validation, which includes fluid api builder so its clear on the preconditions for any validation scenario.

This idea could be replicated for the LimitedPartnershipValidation class as well..... then you could have one controller test to validate javax validation is configured correctly. Removing the complexity of setting up json with valid/ invalid values.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we did follow this validation approach early on, but shelved it for the 'more complete' tests driven by the controller testing. See LimitedPartnershipDtoValidationTest.

I think you're doing essentially the same thing with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, pretty much... I suppose the better example would be to use the custom validator that works on multiple objects. Find the controller tests hard to read, so much going on.... but perhaps thats just me

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