Skip to content
Open
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
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {

implementation('software.amazon.awssdk:s3:2.17.285')

//jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'
runtimeOnly "io.jsonwebtoken:jjwt-impl:0.11.2"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:0.11.2"
Expand All @@ -39,15 +40,20 @@ dependencies {
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

implementation 'io.hypersistence:hypersistence-utils-hibernate-5:3.5.0'

implementation 'org.springframework.boot:spring-boot-starter-data-redis'

//swagger
implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation 'io.springfox:springfox-swagger-ui:3.0.0'

//test
runtimeOnly('com.h2database:h2')
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

}

tasks.named('test') {
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ spring:

spring:
profiles:
active: dev
active: dev

---

spring:
profiles:
active: test
2 changes: 2 additions & 0 deletions src/test/java/com/gam/api/ApiApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest
@ActiveProfiles("test")
class ApiApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.gam.api.controller;

import com.gam.api.config.WebMvcConfig;
import com.gam.api.config.json.CustomObjectMapper;
import com.gam.api.domain.test.controller.TestController;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.web.servlet.MockMvc;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureMockMvc
@WebMvcTest(controllers = TestController.class)
public class HealthCheckControllerTest {
@Autowired
private MockMvc mvc;

@Test
public void healthCheckReturn() throws Exception {
String WELCOME_STRING = "Hello gam Server!";

mvc.perform(get("/health"))
.andExpect(status().isOk())
.andExpect(content().string(WELCOME_STRING));
}
}