Skip to content
Shin edited this page May 30, 2019 · 20 revisions

Screening Service

This service is responsible for managing screenings. A screening is an interview with a potential candidate to determine if they would make a good associate. A screening consists of a series of questions that a screener scores. Candidates are also evaluated on their soft skill abilities.

Data persistence

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.”

Entity Relational Diagram

ERD Diagram

Documentation

Making controller endpoints

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)

How to generate Javadocs

  1. Navigate to the project folder with a terminal (Git Bash on Windows)
  2. Type find -name *.java | awk 'BEGIN{ORS=" "}{print}'
  3. Copy the results
  4. Type javadoc -private -d ./doc -author <paste results here>
    • -private will document private members.
    • -d <path> will set the path to output the documentation.
    • -author will add author information to the documentation.
  5. Open index.html in the doc folder.

Testing

All tests should test for both success and failure.

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). The tests are available in the /src/test/java/com/revature/caliber/services

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.

==========================================================================================================================

JACOCO/EMMA

The dependencies for JACOCO should be placed in the pom.xml To run the tests you can run the application with Maven Clean or within the terminal where the project is located. To do this input ==> mvn clean test You will need to have your maven installed and integrated into your environments.

Sonar Cloud

The dependencies and plugin should be placed within the pom.xml To run the tests from the terminal use ==> mvn clean verify -P sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=revaturelabs-screenforce -Dsonar.login={Login} Replace {Login} with your specific key or one that is provided to you.