본문 바로가기

Programming!

Kotlin Unit Test https://phauer.com/2018/best-practices-unit-testing-kotlin/ Best Practices for Unit Testing in Kotlin Best practices and guidelines for idiomatic and readable unit tests in Kotlin. phauer.com 더보기
버전 맞추기 힘들다... IDE 환경에서 문제없이 Application 이 실행되는데 EC2에 올라가면 main()을 찾을 수 없다고 내게 자꾸 토를 단다. 뭐지 왜지... 하.. 첨부터 디컴파일 해봤으면 바로 알 수 있는 내용인데 말이지. 1. Main Class 관련 https://stackoverflow.com/questions/56861256/gradle-build-failed-main-class-name-has-not-been-configured-and-it-could-not-be Gradle build failed: Main class name has not been configured and it could not be resolved I am building a RESTful web service with Spri.. 더보기
Jenkins Remote API Trigger 간단하게 만들어보기. 서비스를 운영하다보면 간혹 해당 서비스 코드에서 직접 Jenkins의 Task Item을 실행하고 싶을 때가 있다. 어쩌다 한번 콜 하는 형태라 이를 위해 뭔가 막 만들기도 그렇고 해서 난감한 경우가 있는데..여튼.. 그냥 자료 찾아보고 대충 만들어 보자. 음... HTTPS 무시하는게 좀 뜬금이였음. ( HttpClient 4.5 + ) 라이브러리로 사용하기 https://github.com/cdancy/jenkins-rest GitHub - cdancy/jenkins-rest: Java client, built on top of jclouds, for working with Jenkins REST API Java client, built on top of jclouds, for working with.. 더보기
뜬금 Reflection 으로 field 받아오기. getFields와 getDeclaredFields 의 차이는 넘어가고.. --- 플젝도중 누군가 jpa 엔티티의 id를 빼오는 작업을 하는데 해당 작업의 구현시.. 다른 누군가가 만들어둔 유틸성 클래스를 사용하더라. 근데 id가 정상적으로 처리되지 않더라고 한다. ( 아마 ID가 들어있는 class를 extends하는 방식이라 그런거 같다고.. - AbcEntity extends JpaIdBase 뭐 이런식..) 해서 그 누군가가 만들어둔 유틸 클래스를 디컴파일해서 보니 역시나... Arguments 클래스에 getDeclaredFields 를 이용하여 field값들을 처리하더라. 그럼 역시 super class의 field를 볼 수 없는건 당연하겠지. ( 고치면 좋을 듯 한데 유틸 클래스 작성자의 의.. 더보기
Kotlin Kotest + Spring Boot 적용해보기 https://github.com/KimHyeongi/KotlinSpringboot-Tips #1 SpringBootTest 테스트용 서비스 @Service class DicFindService(val dicRepository: DicRepository) { fun findById(id: Long): Dic = checkNotNull(dicRepository.findByIdOrNull(id)) { "검색된 정보가 없습니다." } } 테스트 코드 - Kotest 전역설정 package com.tistory.eclipse4j.domain.persist.dic import io.kotest.core.config.AbstractProjectConfig import io.kotest.core.spec.Isolat.. 더보기