- Ctrl + Alt + O : 임포트 정리
- Ctrl + Alt + L : 포멧팅
- Ctrl + F4 : 창 닫기
- Ctrl + Shift + Enter : 세미콜론
- Ctrl + J : Live code template
- Ctrl + Shift + V : multiple paste
- Alt + Insert : getter, setter 생성
- Ctrl + Shift + F12 : Editor 전체 화면으로
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.hamcrest.CoreMatchers.containsString; | |
| import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | |
| import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; | |
| import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; | |
| import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | |
| @RunWith(SpringRunner.class) | |
| @SpringBootTest | |
| @AutoConfigureMockMvc | |
| public class CurationControllerTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 현재 쓰레드와 관련된 로컬 변수를 하나 생성한다. | |
| ThreadLocal<UserInfo> local = new ThreadLocal<UserInfo>(); | |
| // 로컬 변수에 값 할당 | |
| local.set(currentUser); | |
| // 이후 실행되는 코드는 쓰레드 로컬 변수 값을 사용 | |
| UserInfo userInfo = local.get(); | |
| // 쓰레드 로컬 변수 제거 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class JacksonMixInTest { | |
| // pojo class와 jackson anno 분리 | |
| @Test | |
| public void mixIn테스트() throws IOException { | |
| ObjectMapper mapper = new ObjectMapper(); | |
| mapper.getSerializationConfig().addMixInAnnotations(Bird.class, BirdMixIn.class); | |
| Bird bird = new Bird(); | |
| bird.setName("새됐다"); | |
| bird.setSound("eee"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: k8s-test-deployment | |
| namespace: default | |
| spec: | |
| replicas: 2 | |
| minReadySeconds: 10 | |
| revisionHistoryLimit: 1 # 복구를 위한 히스토리 | |
| strategy: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "ubuntu14.04" | |
| config.vm.network "private_network", ip: "192.168.50.11" | |
| config.vm.network :forwarded_port, guest: 80, host: 80 | |
| config.vm.network :forwarded_port, guest: 8000, host: 8000 | |
| config.vm.provider "virtualbox" do |v| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public enum CurationESName { | |
| INDEX_CURATION(Constants.INDEX_CURATION) | |
| , TYPE_PURCHASE_GOODS(Constants.TYPE_PURCHASE_GOODS) | |
| , TYPE_PAGE_VIEW_GOODS_DETAIL(Constants.TYPE_PAGE_VIEW_GOODS_DETAIL); | |
| CurationESName(String name) { | |
| } | |
| public static class Constants { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grep "list?" localhost_access_log.2017-09-19.txt | awk -F ',' '{print $5}' | sort | uniq -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pods에 포함된 컨테이너의 트래픽 로드 밸런싱을 지원 | |
| kubectl get svc | |
| # 애플리케이션 인스턴스들의 생성과 업데이트를 책임진다. | |
| kubectl get deployments | |
| # Horizontal Pod Autoscaling automatically scales the number of pods in a replication controller | |
| kubectl get hpa | |
| # cpu, memory 모니터링 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | |
| LocalDateTime ldt = LocalDateTime.parse("2017-11-02 23:00", format); | |
| assertThat(23, is(ldt.getHour())); | |
| assertThat(0, is(ldt.getMinute())); | |
| assertThat(11, is(ldt.getMonthValue())); |