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

fixed failing unit test in main #843

Merged
merged 3 commits into from
Oct 10, 2023
Merged

fixed failing unit test in main #843

merged 3 commits into from
Oct 10, 2023

Conversation

mehab
Copy link
Collaborator

@mehab mehab commented Oct 9, 2023

Fixed failing unit test failing build of main branch

Signed-off-by: mehab <meha.bhargava@citi.com>
@@ -110,7 +110,7 @@ void testAnalyzer() throws Exception {
Assertions.assertEquals(RepositoryType.NUGET, analyzer.supportedRepositoryType());
Assertions.assertNotNull(metaModel.getComponent());
Assertions.assertNotNull(metaModel.getLatestVersion());
Assertions.assertNotNull(metaModel.getPublishedTimestamp());
Assertions.assertNull(metaModel.getPublishedTimestamp());
Copy link
Collaborator

@VithikaS VithikaS Oct 9, 2023

Choose a reason for hiding this comment

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

I would suggest to add a comment on assertion and comment it out rather than asserting on Null

https://api.nuget.org/v3-flatcontainer/nunit/index.json - i checked published dates of other versions from this page and for all other packages have published timestamp except for the latest beta version

Test might start failing again if the registration information of package becomes available or a new stable version is published

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the url that the test is going to is set to return 404 in which case the latest version of the component is the existing version that was set while sending the component in. And the date is not set so it is coming as null

Signed-off-by: mehab <meha.bhargava@citi.com>
@mehab mehab requested a review from VithikaS October 10, 2023 10:01
VithikaS
VithikaS previously approved these changes Oct 10, 2023
@@ -34,6 +35,9 @@

import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.Date;
Copy link
Collaborator

Choose a reason for hiding this comment

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

umm.. is sql date required ?

Signed-off-by: mehab <meha.bhargava@citi.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

89.7% 89.7% Coverage
0.0% 0.0% Duplication

@mehab mehab merged commit 782946c into main Oct 10, 2023
12 checks passed
@mehab mehab deleted the feature/testfixformain branch October 10, 2023 13:07
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.

None yet

2 participants