-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: restructure and enhance validation unit tests #4356
Conversation
c88008b
to
879879c
Compare
|
||
@Test | ||
public void setErrorMessage_getErrorMessage() { | ||
HasValidationTestHelper.setErrorMessage_getErrorMessage(testField); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracting the logic definitely makes sense, however this specific pattern results in a lot of noise in Sonar validation, because it does not detect the assertions:
https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&pullRequest=4356&id=vaadin_flow-components&open=AYUQ_8ljB57jh_TraguY
Could we use an abstract test class instead, like AbstractionBasicValidationTest
was used in the text field module?
80241d4
to
c5d2af7
Compare
|
||
import org.junit.BeforeClass; | ||
|
||
public abstract class AbstractValidationTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I assumed that this class can be removed likewise since it is no longer used in the codebase.
...-components-test-util/src/main/java/com/vaadin/tests/validation/HasValidationTestHelper.java
Outdated
Show resolved
Hide resolved
...lect-flow/src/test/java/com/vaadin/flow/component/select/validation/BasicValidationTest.java
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
validation
namespace.HasValidation
interface methods. That was previously covered by integration tests but only to some extent.A continuation of #4350.
Part of vaadin/platform#3066
Covered components
Type of change
Checklist