This assignment was done leveraging Java, mvn, RestAssured, TestNG, and some other Java libraries for base64andSHA512` validation.
Note: I believe the repo is SAFE from the log4j issues. I am using the latest versions of the maven dependencies
- Clone repo
- Maven issued
- Java 1.8 or above
- PORT 8090 is defined (This was used instead of 8088. Had a conflict because I was already using that port for something else)
- IDE that has some integration with TestNG OR
- Use CLI, execute at the root level of the local clone of the repo
mvn compile
- Application only answers on the PORT specified in the PORT environment (See
testInvalidPort)
- Validated that simultaneously requests can be made meaning that multiconnections can be made. This can be seen in the execution of the
concurrency.xmlTestNG.xml file
The execution runs to test run concurrently in 5 threads. (RunstestTwoCallsAandtestTwoCallsBconccurently)
Seeorg.chaves.steven.PasswordConcurrencyTestfor further information.
- Start the server up first.
mvn test -P concurrency-test
The test cases/validation points below are validated by running the shutdown.xml TestNG file. This file runs test methods concurrently which allows the validates of the pending request validations to occur. See org.chaves.steven.PasswordShutdownTest for further information.
- Found that there are occurrences on shutdown that the
portis left open - Validated that In-flight requests are completed (see
testMultipleCalls) - Validated that rejects for new requests are done. Was not able to validated (see
testMultipleCallsandtestShutdown) - Validated that any additional while shutdown is is pending or completed results in
Connection refused(seetestMultipleCallsandtestShutdown)
- Start the server up first.
mvn test -P shutdown-test
Note: The test cleanup tries to restart the server again. If it fails, start up the server again before executing the next test suite.
- Test case - Hashing algorithm doesn't seem to be
SHA512based on the test conducted for password. - SeetestHappyPathValidatePasswordSHA512 - Test case - Post is supported with no data -
Malformed Input - 400(SeetestPostApi) - Test case - Post with invalid parameters - See
testPostAPIInvalidParameters - Test case - Post with empty data - See
testPostWithEmptyDataProvided - Test case - Post with password, but with no value - See
testPostWithInvalidDataNoPasswordValueBUG: Seems to be a bug as this should not allow empty password - Test case - invalid key in the data - See
testPostWithInvalidDataKeyValueBUG: Should probably returned 400 with something about fomrat being incorrect - Test case - validate response time - Validated that 5 seconds elapses for a job identifier to be created and password hash is generated. - See
testPostValidateResponseTime - Test case - Confirm that entire data json is not being used for SHA512- See
testPostNotAllJsonDataSHA512
- Test case - Without job identifier. See
testGetHashWithoutJobIdmethod. - Test case - Without job identifier and data. See
testGetHashWithoutJobIdEmptyDataProvidedmethod. - Test case - Get call with invalid parametersValidated that a job identifier is accepted. See
testGetHashInvalidParametersmethod. - Test case - Job Identifier does not exist - See
testGetHashJobIdNotFoundmethod. - Test case - Job identifier does not exist and supply empty data. See
testGetHashJobIdNotFoundWithDatamethod. - Test case - Happy path - Validated that the string returned in
base64encoded and Job Identifier exists - SeetestGetHashHappyPathmethod.
- Test case - Supply parameters - See
testGetStatsWithParametersmethod. - Test case - Validated that accepts no data - See
testGetStatsWithProvidingDatamethod. - Test case - Validated that accepts empty data - See
testGetStatsWithEmptyDataProvidedmethod. BUG - Expected a 400 here with some type of error message. Same as test case above - Test case - Happy path - Validated that the data structure response in JSON - See
testGetStatsHappyPathmethod. - Test case - Total requests get incremented - Validated that the response has
TotalRequestssince the server started SeetestStatsTotalRequestsBUG - This doesn't seem to be working correctly. Either it takes 5 seconds to be updated because it does increment sometimes. - Test case - Validated that the response when no requests were sent is 0 Total Requests and 0 AverageTime
- Test case - Validated that the response has 'AverageTime` in milliseconds
- Make sure the server is started
mvn test
Please reach out to me: stevenmchaves@gmail.com for further information.