Skip to content

Commit

Permalink
리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Feb 27, 2024
1 parent 1e1fdfe commit 7f62b3e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 41 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ public record PostGetResponse(
String categoryTitle
) {
public static PostGetResponse of(
Post post,
Category category) {
Post post) {
return PostGetResponse.builder()
.id(post.getId())
.title(post.getTitle())
.content(post.getContent())
.categoryTitle(category.getTitle())
.build();
}
}
4 changes: 4 additions & 0 deletions spring-code-for-deploy/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
spring:
config:
activate:
on-profile: local

datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:tcp://localhost/~/test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.seminar.domain;


import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.test.context.ActiveProfiles;

@DataJpaTest
@ActiveProfiles("test")
public class PostTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@DataJpaTest
@SpringBootTest
@ActiveProfiles("test")
public class MemberSaverTest {

@Autowired
private MemberRegister memberSaver;
private MemberRegister memberRegister;

@Test
@DisplayName("SOPT 회원을 등록할 수 있다.")
Expand Down

0 comments on commit 7f62b3e

Please sign in to comment.