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

[vividus-to-zephyr-exporter] Fix validation for zephyr.exporter.source-directory #3044

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

VolhaHurynovich
Copy link
Contributor

@VolhaHurynovich VolhaHurynovich commented Aug 10, 2022

Fixes #3040

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #3044 (6502e02) into master (5cf527a) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #3044   +/-   ##
=========================================
  Coverage     96.81%   96.81%           
  Complexity     5870     5870           
=========================================
  Files           825      825           
  Lines         16658    16658           
  Branches       1076     1076           
=========================================
  Hits          16127    16127           
  Misses          419      419           
  Partials        112      112           
Impacted Files Coverage Δ
...zephyr/configuration/ZephyrExporterProperties.java 15.38% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ConfigurationProperties("zephyr.exporter")
public class ZephyrExporterProperties
{
private String jiraInstanceKey;

@NotBlank(message = "Property 'zephyr.exporter.source-directory' must not be blank")
@NotNull(message = "Property 'zephyr.exporter.source-directory' must be set")
Copy link
Collaborator

Choose a reason for hiding this comment

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

how does this change fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It helps when property is empty, but in case of a non-existent path, we are facing with NoSuchFileException (just like now)
Property is empty:
image

Non-existent path:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to see clear message, I can add try-catch:

    try
    {
        Files.walkFileTree(zephyrExporterProperties.getSourceDirectory(), crawler);
    }
    catch (IOException e)
    {
        throw new NoSuchFileException("Path to directory with test execution JSON results should be corrected: "
                + zephyrExporterProperties.getSourceDirectory());
    }

or create new annotation @FileByPathExists

@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2022

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@valfirst valfirst merged commit 74e37ae into master Aug 11, 2022
@valfirst valfirst deleted the 3040 branch August 11, 2022 06:42
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.

NPE error is displayed in the logs to zephyr-to-vividus plugin
3 participants