Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pipeline/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ build/
.vscode/*

## Don't Ignore Templates
!.vscode/*.template
!.vscode/*.template

### SQLite local dev database ###
*.db
4 changes: 2 additions & 2 deletions pipeline/.vscode/launch.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"projectName": "pipeline",
"console": "internalConsole",
"env": {
"SPRING_PROFILES_ACTIVE": "default,h2InMemory"
"SPRING_PROFILES_ACTIVE": "default,sqlite"
}
},
{
Expand All @@ -20,7 +20,7 @@
"projectName": "pipeline",
"console": "internalConsole",
"env": {
"SPRING_PROFILES_ACTIVE": "basicAuth,h2InMemory"
"SPRING_PROFILES_ACTIVE": "basicAuth,sqlite"
}
}
]
Expand Down
11 changes: 8 additions & 3 deletions pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.47.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-community-dialects</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down Expand Up @@ -318,7 +323,7 @@
<configuration>
<profiles>
<profile>default</profile>
<profile>h2InMemory</profile>
<profile>sqlite</profile>
</profiles>
</configuration>
<executions>
Expand Down
25 changes: 11 additions & 14 deletions pipeline/src/main/resources/application-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@

spring:
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
url: jdbc:sqlite:file::memory:?cache=shared
driver-class-name: org.sqlite.JDBC
username:
password:

jpa:
hibernate:
ddl-auto: create-drop
show-sql: false
database-platform: org.hibernate.dialect.H2Dialect

h2:
console:
enabled: true
path: /h2-console
database-platform: org.hibernate.community.dialect.SQLiteDialect

autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
- org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://mock-issuer.test
jwk-set-uri: https://mock-jwk-set-uri.test

feature-flags:
provider:
Expand Down
14 changes: 5 additions & 9 deletions pipeline/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,16 @@ spring:
spring:
config:
activate:
on-profile: h2InMemory
on-profile: sqlite
datasource:
url: jdbc:h2:mem:mydb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
url: jdbc:sqlite:./pipeline.db
driver-class-name: org.sqlite.JDBC
username:
password:
jpa:
hibernate:
ddl-auto: update
show-sql: false
database-platform: org.hibernate.dialect.H2Dialect
h2:
console:
enabled: true
path: /h2-console
database-platform: org.hibernate.community.dialect.SQLiteDialect


Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.web.servlet.MockMvc;

Expand All @@ -29,16 +28,7 @@
*/
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("demo")
@TestPropertySource(properties = {
"spring.security.oauth2.resourceserver.jwt.issuer-uri=https://mock-issuer.test",
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=https://mock-jwk-set-uri.test",
"spring.datasource.url=jdbc:h2:mem:testdb",
"spring.datasource.driverClassName=org.h2.Driver",
"spring.datasource.username=sa",
"spring.datasource.password=",
"spring.jpa.hibernate.ddl-auto=create-drop"
})
@ActiveProfiles("test")
Comment thread
Baibhab23 marked this conversation as resolved.
Resolved
class SecurityConfigTest {

@Autowired
Expand Down
Loading