diff --git a/pom.xml b/pom.xml
index a2b31f9..fa8101a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,11 +41,11 @@
org.springframework.boot
spring-boot-starter-security
-
- org.springframework.session
- spring-session
- 1.3.5.RELEASE
-
+
+
+
+
+
org.springframework.boot
spring-boot-starter-thymeleaf
@@ -68,6 +68,10 @@
flyway-core
10.15.0
+
+ org.flywaydb
+ flyway-mysql
+
org.projectlombok
lombok
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 2047cbd..08fa94d 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -16,8 +16,8 @@ spring:
database-platform: MYSQL
flyway:
enabled: true
- check-location: true
locations: classpath:/db/migration
+ fail-on-missing-locations: true
# Templates reloading during development
thymeleaf:
cache: false
@@ -39,11 +39,6 @@ spring:
livereload:
enabled: true
add-properties: true
- resources:
- static-locations: file:src/main/resources/static/
- # static-locations: ${project.basedir}/src/main/resources/static/
- cache:
- period: 0
servlet:
multipart:
max-file-size: 5MB
@@ -52,6 +47,11 @@ spring:
location: ${java.io.tmpdir}
session:
store-type: none
+ web:
+ resources:
+ static-locations: file:src/main/resources/static/
+ cache:
+ period: 0
#We can use the httpOnly and secure flags to secure our session cookie:
#
@@ -69,4 +69,4 @@ cookie:
maxAge: 86400
#hendisantika/password
-#admin/password
\ No newline at end of file
+#admin/password
diff --git a/src/test/java/com/hendisantika/adminlte/DatasourceHealthTests.java b/src/test/java/com/hendisantika/adminlte/DatasourceHealthTests.java
new file mode 100644
index 0000000..34ac5df
--- /dev/null
+++ b/src/test/java/com/hendisantika/adminlte/DatasourceHealthTests.java
@@ -0,0 +1,35 @@
+package com.hendisantika.adminlte;
+
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.MySQLContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Project : spring-boot-adminlte
+ * User: hendisantika
+ * Email: hendisantika@gmail.com
+ * Telegram : @hendisantika34
+ * Date: 6/25/24
+ * Time: 23:59
+ * To change this template use File | Settings | File Templates.
+ */
+@Testcontainers
+public class DatasourceHealthTests {
+
+ // will be started before and stopped after each test method
+ @Container
+ private final MySQLContainer mySQLContainer = new MySQLContainer("mysql:8.4.0")
+ .withDatabaseName("users")
+ .withUsername("yuji")
+ .withPassword("S3cret");
+
+ @Test
+ void test() {
+ assertThat(mySQLContainer.isRunning()).isTrue();
+ assertThat(mySQLContainer.isRunning()).isTrue();
+ }
+}
diff --git a/src/test/java/com/hendisantika/adminlte/SistemApplicationTests.java b/src/test/java/com/hendisantika/adminlte/SistemApplicationTests.java
index 134966f..98db62a 100755
--- a/src/test/java/com/hendisantika/adminlte/SistemApplicationTests.java
+++ b/src/test/java/com/hendisantika/adminlte/SistemApplicationTests.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +22,7 @@
},
webEnvironment = RANDOM_PORT
)
+@Disabled
public class SistemApplicationTests {
@Autowired