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

Added Junit Tests for SemanticVersion #2946

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

sonja-ct
Copy link
Contributor

Signed-off-by: Sonja sonja.matic@comtrade.com

Added Junit Tests for SemanticVersion

Signed-off-by: Sonja <sonja.matic@comtrade.com>
Copy link
Contributor

@LeoNerdoG LeoNerdoG left a comment

Choose a reason for hiding this comment

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

Hi @Coduz,
I have checked this branch and it looks OK - can you please merge it when all the tests pass?

@codecov
Copy link

codecov bot commented Apr 23, 2020

Codecov Report

Merging #2946 into develop will increase coverage by 0.51%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2946      +/-   ##
=============================================
+ Coverage      55.23%   55.74%   +0.51%     
- Complexity      2554     2557       +3     
=============================================
  Files           1048     1048              
  Lines          22810    22810              
  Branches        2051     2051              
=============================================
+ Hits           12599    12716     +117     
+ Misses          9253     9148     -105     
+ Partials         958      946      -12     
Impacted Files Coverage Δ Complexity Δ
.../DeviceManagementNotificationMessageProcessor.java 64.28% <0.00%> (-7.15%) 0.00% <0.00%> (ø%)
...atch/persistence/jpa/JpaExecutionInstanceData.java 87.80% <0.00%> (-2.44%) 22.00% <0.00%> (-1.00%)
...apua/job/engine/jbatch/JobEngineServiceJbatch.java 51.85% <0.00%> (-1.86%) 8.00% <0.00%> (-1.00%)
...onfiguration/AbstractKapuaConfigurableService.java 80.90% <0.00%> (+0.90%) 0.00% <0.00%> (ø%)
...se/kapua/commons/configuration/ValueTokenizer.java 43.20% <0.00%> (+2.40%) 0.00% <0.00%> (ø%)
...pse/kapua/service/job/internal/JobServiceImpl.java 81.42% <0.00%> (+2.85%) 20.00% <0.00%> (ø%)
...obDeviceManagementOperationManagerServiceImpl.java 76.82% <0.00%> (+3.65%) 14.00% <0.00%> (+1.00%)
...ce/management/commons/call/DeviceCallExecutor.java 67.44% <0.00%> (+4.65%) 0.00% <0.00%> (ø%)
...a/org/eclipse/kapua/transport/mqtt/MqttClient.java 62.19% <0.00%> (+6.09%) 14.00% <0.00%> (ø%)
...pua/broker/core/listener/ErrorMessageListener.java 61.29% <0.00%> (+6.45%) 0.00% <0.00%> (ø%)
... and 11 more

@Coduz Coduz added the Test Test related stuff. It's a dirty job, but someone needs to do that! label Apr 24, 2020
@Coduz Coduz merged commit 9ff0f34 into eclipse-kapua:develop Apr 24, 2020
@sonja-ct sonja-ct deleted the semanticVersionTests branch April 27, 2020 12:57
LeoNerdoG pushed a commit to LeoNerdoG/kapua that referenced this pull request May 5, 2020
With a fix for a certain REST API bug (preventing users to change their account settings) in PR eclipse-kapua#2946 and PR eclipse-kapua#2954 the unit tests for services (tags, users, jobs, scheduling,...) started to fail.
I have fixed this by introducing a mocked account that is used as basis for the service creation.
I have already ran PR on my Travis and everything was fine. CodeCov should report 0% increased/decreased coverage, since all the changes made are in the ignored folders.

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>

**Related Issue**
This PR fixes problems with unit tests in PR eclipse-kapua#2947 and PR eclipse-kapua#2954.

**Description of the solution adopted:**
I have added a mocked AccountService and mocked AccountFactory classes to the existing unit tests, so that the check does not fail. This is  achieved with Mockito's "spy" method. The necessary Account methods are injected in the _CucumberWithProeprtiesFor(Service)_ file.

@lorthirk can you please look at the solution adopted and see if it's ok? After you merge this PR into develop, just rebase your PRs to develop and the tests should be passing normally.
**Screenshots**
N/A

**Any side note on the changes made**
N/A

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>
LeoNerdoG pushed a commit to LeoNerdoG/kapua that referenced this pull request May 5, 2020
With a fix for a certain REST API bug (preventing users to change their account settings) in PR eclipse-kapua#2946 and PR eclipse-kapua#2954 the unit tests for services (tags, users, jobs, scheduling,...) started to fail.
I have fixed this by introducing a mocked account that is used as basis for the service creation.
I have already ran PR on my Travis and everything was fine. CodeCov should report 0% increased/decreased coverage, since all the changes made are in the ignored folders.

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>

**Related Issue**
This PR fixes problems with unit tests in PR eclipse-kapua#2947 and PR eclipse-kapua#2954.

**Description of the solution adopted:**
I have added a mocked AccountService and mocked AccountFactory classes to the existing unit tests, so that the check does not fail. This is  achieved with Mockito's "spy" method. The necessary Account methods are injected in the _CucumberWithProeprtiesFor(Service)_ file.

@lorthirk can you please look at the solution adopted and see if it's ok? After you merge this PR into develop, just rebase your PRs to develop and the tests should be passing normally.
**Screenshots**
N/A

**Any side note on the changes made**
N/A

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>
LeoNerdoG pushed a commit to LeoNerdoG/kapua that referenced this pull request May 5, 2020
With a fix for a certain REST API bug (preventing users to change their account settings) in PR eclipse-kapua#2946 and PR eclipse-kapua#2954 the unit tests for services (tags, users, jobs, scheduling,...) started to fail.
I have fixed this by introducing a mocked account that is used as basis for the service creation.
I have already ran PR on my Travis and everything was fine. CodeCov should report 0% increased/decreased coverage, since all the changes made are in the ignored folders.

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>

**Related Issue**
This PR fixes problems with unit tests in PR eclipse-kapua#2947 and PR eclipse-kapua#2954.

**Description of the solution adopted:**
I have added a mocked AccountService and mocked AccountFactory classes to the existing unit tests, so that the check does not fail. This is  achieved with Mockito's "spy" method. The necessary Account methods are injected in the _CucumberWithProeprtiesFor(Service)_ file.

@lorthirk can you please look at the solution adopted and see if it's ok? After you merge this PR into develop, just rebase your PRs to develop and the tests should be passing normally.
**Screenshots**
N/A

**Any side note on the changes made**
N/A
LeoNerdoG pushed a commit to LeoNerdoG/kapua that referenced this pull request May 5, 2020
With a fix for a certain REST API bug (preventing users to change their account settings) in PR eclipse-kapua#2946 and PR eclipse-kapua#2954 the unit tests for services (tags, users, jobs, scheduling,...) started to fail.
I have fixed this by introducing a mocked account that is used as basis for the service creation.
I have already ran PR on my Travis and everything was fine. CodeCov should report 0% increased/decreased coverage, since all the changes made are in the ignored folders.

Signed-off-by: Leonardo Gaube <leonardo.gaube@comtrade.com>

**Related Issue**
This PR fixes problems with unit tests in PR eclipse-kapua#2947 and PR eclipse-kapua#2954.

**Description of the solution adopted:**
I have added a mocked AccountService and mocked AccountFactory classes to the existing unit tests, so that the check does not fail. This is  achieved with Mockito's "spy" method. The necessary Account methods are injected in the _CucumberWithProeprtiesFor(Service)_ file.

@lorthirk can you please look at the solution adopted and see if it's ok? After you merge this PR into develop, just rebase your PRs to develop and the tests should be passing normally.
**Screenshots**
N/A

**Any side note on the changes made**
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Test related stuff. It's a dirty job, but someone needs to do that!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants