eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Other
229 stars 72 forks source link

[BUG] Multiple assertion errors in jnosql-communication-key-value module #370

Closed eliasnogueira closed 1 year ago

eliasnogueira commented 1 year ago

Which JNoSQL project the issue refers to?

JNoSQL (Core)

Bug description

NOTE: this issue only happens using Mockito 5.2.0

Context

During the merge of https://github.com/eclipse/jnosql/pull/369, which is improving the tests as a PoC for the jsql-communication-core module, we have found issues in the jnosql-communication-key-value, that's prevent the PR to merge.

Issue

The KeyValueQueryParserTest and GetQueryParserTest classes throw assertion errors for some test methods. More details about the expected results are in the Expected results section and the full detail in the Code example, screenshot, or link to a repository.

Is is happening because of Mockito 5.2.0 version.

JNoSQL Version

JNoSQL version

Steps To Reproduce

Note: issues based on the following PR: https://github.com/eclipse/jnosql/pull/369

  1. Clone the https://github.com/eliasnogueira/jnosql/tree/test-improvements
  2. Update the mockito.version property in the pom.xml file to 5.2.0
  3. Go to the jnosql-communication-key-value module
  4. Run, in your terminal, mvn clean test

Expected Results

Class Test Method Expected result
KeyValueQueryParserTest shouldReturnParserQuery1() "Diana"
KeyValueQueryParserTest shouldReturnSingleResult() 10
KeyValueQueryParserTest shouldReturnEmptySingleResult() 10
GetQueryParserTest shouldReturnParserQuery1() 10
GetQueryParserTest shouldReturnParserQuery2() 12L
GetQueryParserTest shouldReturnParserQuery3() "{"Ana":"Sister","Maria":"Mother"}"
GetQueryParserTest shouldReturnParserQuery4() 2018-01-10
GetQueryParserTest shouldExecutePrepareStatement2() 10
GetQueryParserTest shouldExecutePrepareStatement() 10

Code example, screenshot, or link to a repository

The compressed file is an IntelliJ IDEA HTML report.

Test Results - All_in_jnosql-communication-key-value.html.zip

otaviojava commented 1 year ago

@eliasnogueira I guess it is Mockito new version. Could you keep the same version and run it again? We can create a PR just to update Mockito.

eliasnogueira commented 1 year ago

@eliasnogueira I guess it is Mockito new version. Could you keep the same version and run it again? We can create a PR just to update Mockito.

Doing it now

eliasnogueira commented 1 year ago

@otaviojava bingo! It's the Mockito version.

What I will do: rollback the version in my PR What I can do later: bump the Mockito version into another PR, fixing the issues.

What do you think?

otaviojava commented 1 year ago

I like it!

otaviojava commented 1 year ago

I've created the suggestion as well:

https://github.com/eclipse/jnosql/pull/369#discussion_r1175434286

otaviojava commented 1 year ago

Fixed.