JoyOfCoding
JoyOfCoding copied to clipboard
Small improvements to the REST project
REST project mockito tests should reference constants for parameter names
In the unit tests for the projects servlets, the name of the parameter ("word"
) is used.
https://github.com/DavidWhitlock/PortlandStateJava/blob/770136581e8fcd84662bf5549defe3890beddce9/projects-parent/originals-parent/phonebill-web/src/test/java/edu/pdx/cs410J/phonebillweb/PhoneBillServletTest.java#L49
We should reference the constant in the Servlet
class instead: WORD_PARAMETER
.
Also, based on https://github.com/DavidWhitlock/PortlandStateJavaSummer2022/commit/c438e5a7fd5081cdd6eab04f580408b46400563c, I should do the following:
- In
Project4IT
, assert that nothing is written to standard error when invoking themain
method successfully- This replaces the assertion that the exit code was zero
- Call
throwExceptionIfNotOkayHttpStatus()
in thegetAllDictionaryEntries()
- Or maybe I should move
throwExceptionIfNotOkayHttpStatus()
to theget()
, etc. methods ofHttpRequestHelper
- Or maybe I should move
- Make the output of the
PrettyPrinter
distinct from theTextDumper
- When printing the exception in the
error()
method inProject4
, callex.getMessage()
- Remove the
checkResponseCode()
method fromProject4
Also, in the REST project assignment the description of the -search
option isn't strictly correct:
If the -search option is provided, only the customer, begin and end are required
It is valid to only have the customer name with -search