Closed adityaketkar closed 6 years ago
@prasadtalasila Its well above 90 for all the classes but Security.java How to test the two highlighted exceptions?
@adityaketkar please check the String(byte[] bytes, Charset charset) constructor of String class. You can change the Charset to something that's not compatible with utf-8 and then induce the exception. You can try different character sets mentioned on Charset page.
You can let go of the NoSuchAlgorithmException. Changing that would require dependency injection which is not desirable for this class.
@prasadtalasila Of all the supported character-sets given here, I could not find any which is not compatible. I tried to google it but could not find any solution.
We basically need a valid charset that is not compatible with UTF-8, am I correct?
Yes. Please see this stackoverflow thread. We just need to consider special characters / non-ASCII characters to reveal the difference between the character sets.
@prasadtalasila the Security.createHash() is called in HomeController.java to create hash of the login-id and password of the user.
@adityaketkar You can retain the existing unit tests of Security.createHash() method. Our usage does not demand additional tests for the code. You can focus on adding hamcrest status messages and fixing codeclimate code quality issues.
@adityaketkar good progress. There are still a few more code climate issues.
@prasadtalasila codeclimate says that ip address should be configurable. How do I work around the issue?
@adityaketkar good work.
@adityaketkar good work. Please post the code coverage statistics message / screenshot given by Eclipse for the unit tests of util package. Ideally the code coverage would be 90%+ for all the classes of util package.