Skip to content
Closed
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
18 changes: 18 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test CI

on:
pull_request:
branches: [ develop ] # 디벨롭 브랜치로 들어오는 PR만 실행

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
with:
arguments: test
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ dependencies {
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
testImplementation 'com.h2database:h2'
testImplementation('it.ozimov:embedded-redis:0.7.3') {
exclude group: 'org.slf4j', module: 'slf4j-simple'
exclude group: 'commons-logging', module: 'commons-logging'
}

//AWS S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
Expand Down
802 changes: 0 additions & 802 deletions src/main/resources/static/docs/achievement.html

This file was deleted.

1,568 changes: 0 additions & 1,568 deletions src/main/resources/static/docs/bottle-message.html

This file was deleted.

650 changes: 0 additions & 650 deletions src/main/resources/static/docs/daily-question.html

This file was deleted.

691 changes: 0 additions & 691 deletions src/main/resources/static/docs/quest.html

This file was deleted.

557 changes: 0 additions & 557 deletions src/main/resources/static/docs/test.html

This file was deleted.

860 changes: 0 additions & 860 deletions src/main/resources/static/docs/user.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.bloombackend.global.config;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import redis.embedded.RedisServer;

@Configuration
@Profile("test")
public class EmbeddedRedisConfig {

private final RedisServer redisServer;

public EmbeddedRedisConfig(
@Value("${spring.data.redis.port}") int port) {
this.redisServer = new RedisServer(port);
}

@PostConstruct
public void start() {
redisServer.start();
}

@PreDestroy
public void stop() {
redisServer.stop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;

import java.lang.reflect.Field;
Expand All @@ -42,6 +43,7 @@
@AutoConfigureMockMvc
@AutoConfigureRestDocs
@Transactional
@ActiveProfiles("test")
public class AchievementRestDocsTest {

@Autowired
Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ spring:
enabled: true
max-file-size: 10MB
max-request-size: 10MB
data:
redis:
host: localhost
port: 6379
timeout: 6000ms

oauth:
kakao:
Expand Down
Loading