Skip to content
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

Use Hamcrest assertions instead of JUnit #1749

Open
4 of 55 tasks
tomas-langer opened this issue May 7, 2020 · 5 comments
Open
4 of 55 tasks

Use Hamcrest assertions instead of JUnit #1749

tomas-langer opened this issue May 7, 2020 · 5 comments
Assignees
Labels
2.x Issues for 2.x version branch 3.x Issues for 3.x version branch 4.x Version 4.x help wanted Extra attention is needed P4 testing
Projects

Comments

@tomas-langer
Copy link
Member

tomas-langer commented May 7, 2020

Environment Details

  • Helidon Version: 2.0.0
  • Whole code base

Problem Description

Currently we have a few tests that still use JUnit assertions, such as
assertEquals(actual, expected, "Test a and b are equal")
all of these should be replaced with Hamcrest, such as:
assertThat("Test a and b are equal", actual, is(expected)))

There are a few assertions we can use:
fail("")
assertAll()
assertThrows

  • archetypes/se/target/test-classes/projects/it1/project/it1
  • archetypes/se/target/test-classes/projects/it2/project/it2
  • archetypes/se/target/test-classes/projects/it3/project/it3
  • common/common
  • common/http
  • common/reactive
  • config/encryption
  • config/object-mapping
  • dbclient/jdbc
  • dbclient/mongodb
  • examples/cors
  • examples/employee-app
  • examples/microprofile/hello-world-implicit
  • examples/microprofile/mp1_1-static-content
  • examples/microprofile/openapi-basic
  • examples/openapi
  • examples/quickstarts/helidon-quickstart-mp
  • examples/quickstarts/helidon-quickstart-se
  • examples/quickstarts/helidon-standalone-quickstart-mp
  • examples/quickstarts/helidon-standalone-quickstart-se
  • examples/webserver/basics
  • examples/webserver/comment-aas
  • examples/webserver/jersey
  • examples/webserver/tutorial
  • integrations/cdi/common-cdi/reference-counted-context
  • integrations/cdi/datasource-hikaricp
  • integrations/cdi/datasource-ucp
  • integrations/cdi/eclipselink-cdi
  • integrations/cdi/jpa-cdi
  • integrations/cdi/jpa-weld
  • integrations/cdi/jta-cdi
  • integrations/cdi/jta-weld
  • integrations/cdi/oci-objectstorage-cdi
  • media/common
  • messaging/kafka
  • messaging/messaging
  • metrics/metrics
  • microprofile/config
  • microprofile/fault-tolerance
  • microprofile/jwt-auth
  • microprofile/messaging
  • microprofile/reactive-streams
  • microprofile/openapi
  • microprofile/websocket
  • openapi
  • security/providers/oidc-common
  • tests/apps/bookstore/bookstore-mp
  • tests/apps/bookstore/bookstore-se
  • tests/apps/bookstore/common
  • tests/integration/kafka
  • tests/integration/mp-ws-services
  • tests/integration/native-image/se-1
  • tests/integration/webclient
  • webserver/jersey
  • webserver/tyrus
@romain-grecourt
Copy link
Contributor

Two items have been fixed in helidon-3.x, and will need to be backported in 2.x:

@Captain1653
Copy link
Contributor

@romain-grecourt Can any contributor (not a member of helidon) do backport? I can try to do it. Are there any instructions for backport process in the documentation?

@romain-grecourt
Copy link
Contributor

You can do a backport. There is no special process at the moment (though we've been working on one recently).

A git cherry-pick should do the trick.

Captain1653 added a commit to Captain1653/helidon that referenced this issue Sep 16, 2022
Captain1653 added a commit to Captain1653/helidon that referenced this issue Sep 16, 2022
Captain1653 added a commit to Captain1653/helidon that referenced this issue Sep 21, 2022
romain-grecourt pushed a commit that referenced this issue Sep 23, 2022
Captain1653 added a commit to Captain1653/helidon that referenced this issue Sep 23, 2022
Captain1653 added a commit to Captain1653/helidon that referenced this issue Sep 23, 2022
Captain1653 added a commit to Captain1653/helidon that referenced this issue Apr 15, 2023
Captain1653 added a commit to Captain1653/helidon that referenced this issue Apr 18, 2023
Captain1653 added a commit to Captain1653/helidon that referenced this issue Apr 18, 2023
romain-grecourt pushed a commit to Captain1653/helidon that referenced this issue Apr 21, 2023
romain-grecourt pushed a commit to Captain1653/helidon that referenced this issue Jun 5, 2023
romain-grecourt pushed a commit to Captain1653/helidon that referenced this issue Jun 5, 2023
romain-grecourt added a commit that referenced this issue Jun 6, 2023
… backport 2.x (#1749) (#5252)

* Use Hamcrest assertions instead of JUnit in  integrations/cdi/jpa-cdi - backport 2.x (#1749)

* Fix copyright headers

* Add hamcrest-all to dependencies of eclipselink-maven-plugin (#1749)

---------

Co-authored-by: Romain Grecourt <romain.grecourt@oracle.com>
@tomas-langer tomas-langer added help wanted Extra attention is needed testing 3.x Issues for 3.x version branch 4.x Version 4.x labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch 3.x Issues for 3.x version branch 4.x Version 4.x help wanted Extra attention is needed P4 testing
Projects
Backlog
  
In Progress
Development

No branches or pull requests

5 participants