Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9680865
Add .env file for private data
Jun 12, 2024
9c1c5ce
Add docker-compose.yml
Jun 12, 2024
d5ef5db
Merge pull request #1 from ZaharKalosha/feature/postgres-automation-a…
ZaharKalosha Jun 12, 2024
39f1388
Add new .env veriable DB_NAME
Jun 12, 2024
050cb9a
Merge pull request #2 from ZaharKalosha/feature/postgres-automation-a…
ZaharKalosha Jun 12, 2024
3725e60
Refactor pom.sql and add h2 dependency
Jun 12, 2024
d7a806e
Bug: QuestionControllerTest have problem with Autowiring
Jun 13, 2024
95049a3
Fix pom.xml junit dependency
Jun 13, 2024
5b82e53
Add application.properties for test directory
Jun 13, 2024
37174b5
Add first correct test
Jun 13, 2024
bab3c32
Add QuestionController test
Jun 14, 2024
27d8a89
Fix antipatterns in tests
Jun 14, 2024
ae1f093
Fix tests methods
Jun 14, 2024
3cd1219
Clean tests class
Jun 14, 2024
095cf1c
Merge pull request #3 from ZaharKalosha/feature/create-tests
ZaharKalosha Jun 14, 2024
c02e4e9
Add questionDTOs and move all business logic from Controller to service
Jun 14, 2024
140bfd9
Add constructor instead of injection
Jun 17, 2024
9919849
Add String.join()
Jun 17, 2024
8c20fd6
Changes the signature of the delete function
Jun 17, 2024
7c35883
Add all data
ZaharKalosha Jun 18, 2024
218a21b
Add fixes to the tests
Kavazar-i Jun 20, 2024
62f5148
Add Captor to the tests but i am not sure that it's correct
Kavazar-i Jun 20, 2024
4ac170f
Rewrite testCreate with capturedQuestion
Kavazar-i Jun 20, 2024
4fda6bc
Add ParameterizedTest fpr createTest
Kavazar-i Jun 20, 2024
f173b88
Add MethodSource and checking of body
Kavazar-i Jun 20, 2024
863a8a8
Merge pull request #4 from ZaharKalosha/feature/question-controller-r…
ZaharKalosha Jun 20, 2024
cf1cb5c
Update entity of user
Kavazar-i Jun 21, 2024
048c7e6
Add user field to question and refactor service and controller
Kavazar-i Jun 21, 2024
f88ff4a
Add user's service and controller
Kavazar-i Jun 21, 2024
edb355f
Add user's in controllers.
Kavazar-i Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DB_URL=
DB_USER=
DB_PASSWORD=
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.5'

services:
postgres-automaton:
container_name: postgres_demo_application
image: postgres:latest
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
PGDATA: /data/postgres
volumes:
- ./postgres-db:/data/postgres
10 changes: 5 additions & 5 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
spring.datasource.username= postgres
spring.datasource.password=
spring.datasource.url=jdbc:postgresql://${DB_URL}:5432/${DB_USER}
spring.datasource.username=${DB_USER}
spring.datasource.password=${DB_PASSWORD}

# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
spring.jpa.hibernate.ddl-auto=update