Skip to content

Instantly share code, notes, and snippets.

View SeokRae's full-sized avatar
😝
smile

SR SeokRae

😝
smile
  • Seoul
View GitHub Profile
@SpringBootApplication
public class MultiProfileServerApplication {
public static void main(String[] args) {
SpringApplication.run(MultiProfileServerApplication.class, args);
}
@Profile(value = "command")
@Bean
public CommandLineRunner init() {
@Slf4j
@Getter
@ToString
@ConfigurationProperties(prefix = "file")
public class FileProperties {
private final Map<String, PathProperties> names;
private final Resources resources;
private final String userDir;
private final String projDir;
@Slf4j
@Getter
@ConfigurationProperties(prefix = "file")
public class FileProperties {
private final Map<String, PathProperties> names;
private final Resources resources;
private final String userDir;
private final String projDir;
@SeokRae
SeokRae / LibraryServiceTest.java
Created October 1, 2023 17:35
서비스 시나리오 테스트
@SuppressWarnings("NonAsciiCharacters")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class LibraryServiceTest {
private static LibraryService libraryService;
private static LibraryRepository libraryRepository;
@BeforeAll
static void beforeAll() {
@SeokRae
SeokRae / LibraryFileRepositoryTest.java
Created October 1, 2023 17:25
도서 상태 변경 시나리오 테스트
@SuppressWarnings("NonAsciiCharacters")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class LibraryFileRepositoryTest {
private static LibraryRepository libraryRepository;
@BeforeAll
static void beforeAll() {
libraryRepository = new LibraryFileRepository();
@SeokRae
SeokRae / CSVFileHandlerTest.java
Created October 1, 2023 16:10
파일 입출력 테스트
@SuppressWarnings("NonAsciiCharacters")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.class)
class CSVFileHandlerTest {
private static CSVFileHandler csvFileHandler;
private static List<Book> books = new ArrayList<>();
@BeforeAll
@SeokRae
SeokRae / BookServiceUnitTest.java
Created September 30, 2023 10:26
mokito를 활용한 단위 테스트
class BookServiceUnitTest {
private BookRepository bookRepository;
private BookService bookService;
@BeforeEach
void setup() {
bookRepository = mock(BookRepository.class); // Mockito를 이용하여 BookRepository를 모킹합니다.
bookService = new BookService(bookRepository); // 모킹된 Repository를 BookService에 주입합니다.
}
@Slf4j
public class SeedUtil {
/* 개선 버전 */
public static byte[] encryptCBC(String plainText, byte[] key, String iv) throws Exception {
try {
byte[] planTextBytes = plainText.getBytes();
byte[] ivBytes = iv.getBytes();
@SeokRae
SeokRae / README.md
Created August 7, 2023 02:27
endpoint
설명 method endPoint
결제창
accessToken 발급 POST /v1/access-token
승인 POST /v1/payments/{tid}
취소 POST /v1/payments/{tid}/cancel
망상취소 (orderId) POST /v1/payments/netcancel
거래조회 - tid GET /v1/payments/{tid}
거래조회 - orderId GET /v1/payments/find/{orderId}