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

Refactor time related utility methods #2164

Merged
merged 4 commits into from Mar 29, 2019

Conversation

ypadron-in
Copy link
Collaborator

PR #2113 exposed failures in tests of DefaultMailCreator class: createErrorEmail, createFirstErrorMessage and createSuccessEmail.

Failures were related to an early initialization of a static SimpleDateFormat object inside the class. As a result of this, changes to the default timezone made later in the tests did not have an effect on that object.

This PR solves this issue by eliminating the use of non-immutable static fields in the utility method that formats dates. It also moves time related utility methods from across the project into a newly created TimeUtils class.

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #2164 into master will increase coverage by 0.09%.
The diff coverage is 27.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2164      +/-   ##
============================================
+ Coverage     33.81%   33.91%   +0.09%     
- Complexity     2815     2819       +4     
============================================
  Files           421      421              
  Lines         29859    29784      -75     
  Branches       3780     3767      -13     
============================================
+ Hits          10096    10100       +4     
+ Misses        18863    18787      -76     
+ Partials        900      897       -3
Impacted Files Coverage Δ Complexity Δ
az-core/src/main/java/azkaban/utils/Utils.java 52.44% <ø> (+7.47%) 38 <0> (-6) ⬇️
...ava/azkaban/webapp/servlet/FlowTriggerServlet.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...azkaban/webapp/servlet/AbstractAzkabanServlet.java 6.06% <0%> (-0.71%) 6 <0> (ø)
...src/main/java/azkaban/webapp/servlet/WebUtils.java 24.24% <0%> (ø) 2 <0> (?)
...n/java/azkaban/webapp/servlet/ScheduleServlet.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...mmon/src/main/java/azkaban/scheduler/Schedule.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../src/main/java/azkaban/execapp/TriggerManager.java 12.82% <0%> (ø) 3 <0> (ø) ⬇️
.../main/java/azkaban/trigger/builtin/SlaChecker.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../azkaban/flowtrigger/TriggerInstanceProcessor.java 89.7% <100%> (ø) 12 <0> (ø) ⬇️
.../src/restli/java/azkaban/restli/ResourceUtils.java 16.66% <100%> (-4.39%) 1 <0> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cda04e...625838f. Read the comment docs.

@coveralls
Copy link

Copy link
Contributor

@burgerkingeater burgerkingeater left a comment

Choose a reason for hiding this comment

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

Thanks

@burgerkingeater burgerkingeater merged commit 4e212eb into azkaban:master Mar 29, 2019
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

3 participants