diff --git a/pom.xml b/pom.xml
index ff160fd..2c23e76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,14 +14,14 @@
org.springframework.boot
spring-boot-starter-parent
- 2.0.1.RELEASE
+ 2.5.5
UTF-8
UTF-8
- 1.8
+ 11
@@ -33,7 +33,10 @@
org.springframework.boot
spring-boot-starter-web
-
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
org.postgresql
postgresql
diff --git a/src/main/java/com/example/postgresdemo/model/Answer.java b/src/main/java/com/example/postgresdemo/model/Answer.java
index d9e3bc7..b5e48d0 100644
--- a/src/main/java/com/example/postgresdemo/model/Answer.java
+++ b/src/main/java/com/example/postgresdemo/model/Answer.java
@@ -21,7 +21,7 @@ public class Answer extends AuditModel {
@Column(columnDefinition = "text")
private String text;
- @ManyToOne(fetch = FetchType.LAZY)
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "question_id", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@JsonIgnore
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index ff398ee..35b376a 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,6 +1,6 @@
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
-spring.datasource.username= rajeevkumarsingh
+spring.datasource.username= postgres
spring.datasource.password=
# The SQL dialect makes Hibernate generate better SQL for the chosen database
diff --git a/src/test/java/com/example/postgresdemo/PostgresDemoApplicationTests.java b/src/test/java/com/example/postgresdemo/PostgresDemoApplicationTests.java
index 163f493..dea7bde 100644
--- a/src/test/java/com/example/postgresdemo/PostgresDemoApplicationTests.java
+++ b/src/test/java/com/example/postgresdemo/PostgresDemoApplicationTests.java
@@ -1,11 +1,8 @@
package com.example.postgresdemo;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringRunner.class)
@SpringBootTest
public class PostgresDemoApplicationTests {