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 some utilities and TODO done #301

Merged
merged 1 commit into from Dec 8, 2015
Merged

Conversation

Ariel-Isaacm
Copy link
Contributor

Hey guys, awesome framework +1 i've been looking at the code and i did some improvements, also i did a TODO but i'm not quite sure how to handle that null check it would be awesome if you could check it out @bric3 @szczepiq

Answers.java : private is not required
ClassPathLoader.java: Removed unnecessary imports
ScenarioPrinter.java: Changed the string concat into another append
MockHandlerFactory.java: Return statement changed to be inline
ValuePrinter.java: TODO done, null check added

Edit
ReleaseNotesExtension : Made authToken a final String

Edit 2:
Some improvements to the ThreadTests :)

@codecov-io
Copy link

Current coverage is 83.76%

Merging #301 into master will decrease coverage by -0.15% as of d601381

@@            master    #301   diff @@
======================================
  Files          270     270       
  Stmts         4669    4675     +6
  Branches       754     758     +4
  Methods          0       0       
======================================
- Hit           3918    3916     -2
- Partial        220     224     +4
- Missed         531     535     +4

Review entire Coverage Diff as of d601381


Uncovered Suggestions

  1. +0.19% via ...rningsCollector.java#23...31
  2. +0.15% via ...ializableMethod.java#97...103
  3. +0.11% via ...lizationSupport.java#122...126
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@@ -170,7 +170,7 @@ public static boolean runInMultipleThreads(int numberOfThreads) throws Exception
boolean failed = false;
for (AllTestsRunner t : threads) {
t.join();
failed = failed ? true : t.isFailed();
failed = failed || t.isFailed();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does a |= also work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! you're right i already made the changes thanks for your comments :)

@Ariel-Isaacm
Copy link
Contributor Author

Commits squashed*

@pmduaree
Copy link

Good job! The refactor is well done and the code is cleaner now.

Maybe the coverage is gonna be decreased thanks to the null check. Maybe a new test will do.

if(start == null || separator == null || end == null || values == null){
return "";
//TODO handle this situation
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just replace null by some default values of each fields

@bric3
Copy link
Contributor

bric3 commented Dec 8, 2015

Looks good to me, I think you can just fixup the todo with my comment

@Ariel-Isaacm
Copy link
Contributor Author

Hi, i did the changes, are they what you expected? and should i squash the two commits?

@raphw
Copy link
Member

raphw commented Dec 8, 2015

Yes please. Thank you!

Refactor some utilities and TODO done

Refactor some utilities and TODO done

refactor for boolean condition and null check improved

Refactor some utilities and TODO done

Refactor some utilities and TODO done

Refactor some utilities and TODO done

refactor for boolean condition and null check improved

Null check improved

Default value changed
@Ariel-Isaacm
Copy link
Contributor Author

Done :)

bric3 added a commit that referenced this pull request Dec 8, 2015
Refactor some utilities and TODO done
@bric3 bric3 merged commit 2f21db0 into mockito:master Dec 8, 2015
@bric3
Copy link
Contributor

bric3 commented Dec 8, 2015

Thanks @Ariel-Isaacm for the contribution

@Ariel-Isaacm
Copy link
Contributor Author

Thanks you for your patience :) @bric3 @raphw

@raphw
Copy link
Member

raphw commented Dec 8, 2015

No, thank you!

@bric3
Copy link
Contributor

bric3 commented Dec 8, 2015

Yes exactly it was quite the opposite, thanks for the patience ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants