-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The screening admin service provides administrators control over questions asked during candidate screenings. The functionality that this application affords administrators with is the ability to modify questions and their respective organizational hierarchies. The service provides CRUD functionality to the following Screenforce entities: question, bucket, skill-type, and weight.
This application currently uses an in-memory H2 database. Necessary data to create & populate this database lives in src/main/resources/data.sql.
From the spring documentation: “Be careful when switching from in-memory to a ‘real’ database that you do not make assumptions about the existence of the tables and data in the new platform. . . In a JPA-based app, you can choose to let Hibernate create the schema or use schema.sql, but you cannot do both. Make sure to disable spring.jpa.hibernate.ddl-auto if you use schema.sql.”
Any DELETE, PUT, PATCH request should always be validated before action. Each should have proper error status code. This is important as the front end will be relying on the HTTP Status on what to do. Consistency is key
The current design of our REST API service is as follow. References
- GET request should be:
/collection/{id}
- PUT request should be:
/collection/{id}
- DELETE request should be:
/collection/{id}
For multiple GET/DELETE (if needed), please advice using parameter
/collection?id={id1},{id2}
PATCH request should be implemented as needed; PATCH can be used to do multiple update and delete(if need)
Documentation is provided with Javadocs. Javadocs are HTML pages that are easy to navigate and read. The javadocs program is part of the JDK, so no additional software needs to be downloaded. To generate your own javadocs:
- Get a list of all the java files in your project separated by spaces (including pathnames)
- NOTE: Unfortunately javadoc does not read input from stdin, and using a method like
find -name *.java -exec javadoc {} \;
will overwrite output files for each call - Can easily generate a list by running the following command (in Bash):
find -name *.java | awk 'BEGIN{ORS=" "}{print}'
- NOTE: Unfortunately javadoc does not read input from stdin, and using a method like
- Run
javadoc <paste output of awk command here>
- Some useful options here will be:
-
-private
- show all public/protected/default/private data members and methods of a class -
-d
- specifies the directory to place output files -
-author
- uses the @author annotation in each class
-
- Some useful options here will be:
- Tada!
Most likely, running the javadoc tool will generate a lot of errors / warnings, but these can be ignored as they are not fatal in generating the HTML documents. These could probably cleared up with some additional configuration, in the future.
Swagger annotations have also been added to provide a model of the API. To view Swagger documentation, start the screening-admin-service and navigate to:<hostName:portNumber>/screening-admin/users/documentation/v2/api-docs
JUnit tests were written to test each entity's service implementations. Due to refactoring of the Caliber entities, we needed a way to know whether our refactors were functioning properly and the behavior of the entities was anticipated (proper insertions, deletions, updates, etc. within the database). These tests are available in the /src/test/java/com/revature/screenforce/services directory.
RestAssured tests were written to test the functionality of our controller endpoints. The tests are available in the following directory: /src/test/java/com/revature/screenforce/controllers.
Tests were written with Postman to test functionality of endpoints for the the RESTful service. These postman tests are available in the /test/ directory. A Postman test is expected to be written for each ApiResponse that the controller returns.