connell-class / revassess

this is a trial repo for making a template for the revature assessment
2 stars 11 forks source link

Incomplete or Inconsistent Data in the Postgresql Database #48

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug There is incomplete or inconsistent data in the Postgresql Database. When running the following sql query for answer 4 for tier 2 with the Postgresql database it fails the associated unit test, when running the same query with the Oracle Database the associated unit test for answer 4 for tier 2.

SELECT u.username, ss.name, c.name, f.question, f.answer FROM app_user u JOIN study_set ss ON u.user_id = ss.owner_id JOIN study_set_card USING (study_set_id) JOIN flashcard f USING (flashcard_id) JOIN category c USING (category_id) WHERE u.user_id = ( SELECT owner_id FROM study_set WHERE study_set_id = 4);

To Reproduce Steps to reproduce the behavior: Generate a repository from the template repository. In git bash change the directory to a desired location for cloning the repository to. In git bash clone the generated repository in the desired repository. In git bash cd into the cloned repository. (complete tier1 questions) In git bash checkout the tier2 branch. Using a basic text editor (I used notepad) add the database credentials for the Postgresql Database to the setup.properties file. Make sure that the following query is in the answer4.sql file.

SELECT u.username, ss.name, c.name, f.question, f.answer FROM app_user u JOIN study_set ss ON u.user_id = ss.owner_id JOIN study_set_card USING (study_set_id) JOIN flashcard f USING (flashcard_id) JOIN category c USING (category_id) WHERE u.user_id = ( SELECT owner_id FROM study_set WHERE study_set_id = 4);

Use an IDE (I used Intellij) to execute the unit tests.

Using a basic text editor (I used notepad) to change the database credentials for the Oracle Database to the setup.properties file. Use an IDE (I used Intellij) to execute the unit tests.

Expected behavior The unit test for the Postgresql database should fail saying the expected number of records is 16 and the actual number is 9, with the following errror: java.lang.AssertionError: Expected :16 Actual :9

The unit test for the Oracle database should pass.

Screenshots N/A

Desktop (please complete the following information):

Additional context

connellrobert commented 4 years ago

fixed v2 version