Skip to content

Commit 863f76e

Browse files
authored
Merge pull request #6 from Amin7410/Amin1
Amin1
2 parents 29b5447 + e96031a commit 863f76e

6 files changed

Lines changed: 81 additions & 78 deletions

File tree

nox-platform/backend/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ dependencies {
3434
runtimeOnly("org.postgresql:postgresql")
3535
annotationProcessor("org.projectlombok:lombok")
3636
testImplementation("org.springframework.boot:spring-boot-starter-test")
37+
testImplementation("org.springframework.boot:spring-boot-testcontainers")
38+
testImplementation("org.testcontainers:junit-jupiter")
39+
testImplementation("org.testcontainers:postgresql")
3740
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")
3841
implementation("org.springframework.boot:spring-boot-starter-security")
3942
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import yaml
2+
import sys
3+
4+
class UniqueKeyLoader(yaml.SafeLoader):
5+
def construct_mapping(self, node, deep=False):
6+
mapping = []
7+
for key_node, value_node in node.value:
8+
key = self.construct_object(key_node, deep=deep)
9+
if key in [m[0] for m in mapping]:
10+
print(f"Duplicate key found: {key}")
11+
mapping.append((key, self.construct_object(value_node, deep=deep)))
12+
return super().construct_mapping(node, deep)
13+
14+
def check_yaml(filepath):
15+
print(f"Checking {filepath}...")
16+
try:
17+
with open(filepath, 'r') as f:
18+
yaml.load(f, Loader=UniqueKeyLoader)
19+
except Exception as e:
20+
print(f"Error parsing {filepath}: {e}")
21+
22+
if __name__ == "__main__":
23+
for arg in sys.argv[1:]:
24+
check_yaml(arg)

nox-platform/backend/src/main/resources/application-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,29 @@ spring:
44
mail:
55
host: localhost
66
port: 1025
7+
username: test@test.com
8+
password: test
9+
properties:
10+
mail:
11+
smtp:
12+
auth: true
13+
starttls:
14+
enable: true
15+
protocol: smtp
16+
datasource:
17+
url: jdbc:h2:mem:testdb
18+
driver-class-name: org.h2.Driver
19+
username: sa
20+
password: ""
21+
jpa:
22+
hibernate:
23+
ddl-auto: create-drop
24+
properties:
25+
hibernate:
26+
dialect: org.hibernate.dialect.H2Dialect
27+
flyway:
28+
enabled: false
29+
30+
app:
31+
frontend:
32+
url: http://localhost:3000

nox-platform/backend/src/main/resources/application.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ server:
55
spring:
66
application:
77
name: nox-platform
8-
mail:
9-
host: ${MAIL_HOST:localhost}
10-
port: ${MAIL_PORT:1025}
11-
username: ${MAIL_USERNAME:}
12-
password: ${MAIL_PASSWORD:}
8+
139
datasource:
1410
url: jdbc:postgresql://localhost:5432/nox_core
1511
username: nox

nox-platform/backend/src/test/java/com/nox/platform/module/tenant/service/VerificationTest.java

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
spring:
2+
cache:
3+
type: simple
4+
mail:
5+
host: localhost
6+
port: 1025
7+
username: test@test.com
8+
password: test
9+
properties:
10+
mail:
11+
smtp:
12+
auth: true
13+
starttls:
14+
enable: true
15+
protocol: smtp
16+
datasource:
17+
driver-class-name: org.postgresql.Driver
18+
jpa:
19+
hibernate:
20+
ddl-auto: update
21+
database-platform: org.hibernate.dialect.PostgreSQLDialect
22+
flyway:
23+
enabled: true
24+
25+
app:
26+
frontend:
27+
url: http://localhost:3000

0 commit comments

Comments
 (0)