File tree 14 files changed +64
-38
lines changed
main/kotlin/org/ionproject/codegarten
pipeline/exceptionhandling
test/kotlin/org/ionproject/codegarten
14 files changed +64
-38
lines changed Original file line number Diff line number Diff line change
1
+ COMPOSE_PROJECT_NAME = codegarten
Original file line number Diff line number Diff line change
1
+ version : " 3.3"
2
+ services :
3
+ codegarten-server :
4
+ container_name : codegarten-server
5
+ build :
6
+ context : ../code/jvm
7
+ dockerfile : Dockerfile
8
+ env_file : ./env_server
9
+ environment :
10
+ - JDBC_DATABASE_URL=jdbc:postgresql://codegarten-db:5432/db?user=codegarten&password=changeit
11
+ - CODEGARTEN_TEST_DB_CONNECTION_STRING=jdbc:postgresql://codegarten-db-tests:5433/db?user=codegarten&password=changeit
12
+ depends_on :
13
+ - codegarten-db
14
+ - codegarten-db-tests
15
+ ports :
16
+ - 8080:8080
17
+ codegarten-web :
18
+ container_name : codegarten-web
19
+ build :
20
+ context : ../code/js
21
+ dockerfile : Dockerfile
22
+ env_file : ./env_web
23
+ environment :
24
+ - CG_SERVER_API_HOST=http://codegarten-server:8080
25
+ - CG_SERVER_IM_HOST=http://localhost:8080
26
+ depends_on :
27
+ - codegarten-server
28
+ ports :
29
+ - 80:80
30
+ codegarten-db :
31
+ container_name : codegarten-db
32
+ build :
33
+ context : ../code
34
+ dockerfile : jvm/tests/Dockerfile-codegarten-db
35
+ environment :
36
+ - POSTGRES_USER=codegarten
37
+ - POSTGRES_PASSWORD=changeit
38
+ - POSTGRES_DB=db
39
+ ports :
40
+ - 5432:5432
41
+ codegarten-db-tests :
42
+ container_name : codegarten-db-tests
43
+ build :
44
+ context : ../code
45
+ dockerfile : jvm/tests/Dockerfile-codegarten-db-tests
46
+ environment :
47
+ - POSTGRES_USER=codegarten
48
+ - POSTGRES_PASSWORD=changeit
49
+ - POSTGRES_DB=db
50
+ ports :
51
+ - 5433:5432
Original file line number Diff line number Diff line change
1
+ # Docker environment files
2
+ env_web
3
+ env_server
4
+
1
5
# Logs
2
6
logs
3
7
* .log
@@ -68,10 +72,6 @@ typings/
68
72
# Yarn Integrity file
69
73
.yarn-integrity
70
74
71
- # dotenv environment variables file
72
- .env
73
- .env.test
74
-
75
75
# parcel-bundler cache (https://parceljs.org/)
76
76
.cache
77
77
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ WORKDIR /app
4
4
5
5
COPY ./node_modules ./node_modules
6
6
COPY ./public ./public
7
- COPY secrets ./secrets
8
7
COPY ./dist ./dist
9
8
COPY ./views ./views
10
9
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ WORKDIR /app
5
5
6
6
COPY ${DEPENDENCY}/BOOT-INF/lib ./server/lib
7
7
COPY ${DEPENDENCY}/META-INF ./server/META-INF
8
- COPY secrets ./secrets
9
8
COPY ${DEPENDENCY}/BOOT-INF/classes ./server
10
9
11
10
EXPOSE 8080
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ import org.springframework.util.Base64Utils
25
25
import org.springframework.web.method.support.HandlerMethodArgumentResolver
26
26
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
27
27
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
28
- import java.lang.IllegalArgumentException
29
- import java.lang.IllegalStateException
30
28
import java.net.URI
31
29
32
30
@ConfigurationPropertiesScan
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ class ExceptionHandler {
192
192
val cause = ex.cause as SQLException
193
193
val psqlError = ex.getPsqlErrorCode()
194
194
195
+ logger.error(" [DB Exception] ${cause.localizedMessage} " )
195
196
if (psqlError == null ) {
196
197
return handleExceptionResponse(
197
198
URI (" /problems/database-error" ),
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ package org.ionproject.codegarten.utils
3
3
import org.bouncycastle.jce.provider.BouncyCastleProvider
4
4
import org.bouncycastle.util.io.pem.PemReader
5
5
import org.springframework.util.Base64Utils
6
- import java.io.FileReader
7
- import java.io.Reader
8
6
import java.security.Key
9
7
import java.security.KeyFactory
10
8
import java.security.MessageDigest
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package org.ionproject.codegarten.auth
2
2
3
3
import org.ionproject.codegarten.database.dto.User
4
4
import org.ionproject.codegarten.exceptions.AuthorizationException
5
- import org.junit.jupiter.api.Assertions.*
5
+ import org.junit.jupiter.api.Assertions.assertEquals
6
+ import org.junit.jupiter.api.Assertions.assertThrows
7
+ import org.junit.jupiter.api.Assertions.fail
6
8
import org.junit.jupiter.api.Test
7
9
8
10
class AuthHeaderValidatorTest {
Original file line number Diff line number Diff line change 1
1
package org.ionproject.codegarten.utils
2
2
3
- import org.junit.jupiter.api.Assertions.*
3
+ import org.junit.jupiter.api.Assertions.assertEquals
4
+ import org.junit.jupiter.api.Assertions.assertFalse
5
+ import org.junit.jupiter.api.Assertions.assertNotEquals
6
+ import org.junit.jupiter.api.Assertions.assertTrue
4
7
import org.junit.jupiter.api.Test
5
8
import org.springframework.beans.factory.annotation.Autowired
6
9
import org.springframework.boot.test.context.SpringBootTest
You can’t perform that action at this time.
0 commit comments