Skip to content

Commit

Permalink
anton-liauchuk#14 add liquibase dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-liauchuk committed Jun 13, 2021
1 parent 3576be1 commit 9548a3a
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
databaseChangeLog:
- changeSet:
id: 2020_06_07-1
author: antonliauchuk
preConditions:
onFail: MARK_RAN
not:
tableExists:
tableName: course_proposal
changes:
- createTable:
tableName: course_proposal
columns:
- column:
name: id
type: int
autoIncrement: true
startWith: 1
incrementBy: 1
constraints:
primaryKey: true
primaryKeyName: course_proposal_pk
- column:
constraints:
nullable: false
name: uuid
type: uuid
- column:
constraints:
nullable: false
name: status
type: VARCHAR(14)
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ dependencies {
exclude group: "org.axonframework", module: "axon-server-connector"
}

//
//runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'com.h2database:h2'
}
1 change: 1 addition & 0 deletions configuration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
implementation project(':common')

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.liquibase:liquibase-core'

testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation "org.mockito:mockito-junit-jupiter:${Versions.mockito}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
@SpringBootApplication
@PropertySource("application-security.properties")
public class EducationalPlatformApplication {

public static void main(String[] args) {
Expand Down
1 change: 1 addition & 0 deletions configuration/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
databaseChangeLog:
- include:
file: "classpath*:/db/administration.yml"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.jdbc.Sql;

import java.util.UUID;
Expand All @@ -18,6 +19,7 @@
* Represents API tests for course enrollments functionality.
*/
@Sql(scripts = "classpath:insert_data.sql")
@TestPropertySource("classpath:application-security.properties")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CourseEnrollmentApiTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.jdbc.Sql;

import com.educational.platform.security.SignUpHelper;
Expand All @@ -24,6 +25,7 @@
* Represents API tests for course reviews functionality.
*/
@Sql(scripts = "classpath:insert_data.sql")
@TestPropertySource("classpath:application-security.properties")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CourseReviewApiTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.jdbc.Sql;

import java.util.UUID;
Expand All @@ -18,6 +19,7 @@
* Represents API tests for course functionality.
*/
@Sql(scripts = "classpath:insert_data.sql")
@TestPropertySource("classpath:application-security.properties")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CourseApiTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.educational.platform.security.enabled=true
1 change: 0 additions & 1 deletion security/config/src/main/resources/application.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;

import static io.restassured.RestAssured.given;

/**
* Represents API tests for user functionality.
*/
@TestPropertySource("classpath:application-security.properties")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class UserApiTest {

Expand Down

0 comments on commit 9548a3a

Please sign in to comment.