자바로 코딩을 하다보면 문자열 중간에 -
혹은 ,
등을 넣어야 할 때가 있다. 이때 쉽게 할 수 있는 방법으로 다음과 같은 방식을 사용하곤 했다.
@Test
발표자: 박성철
발표자료: Java.next()
애플리케이션이 정상적으로 종료되는 것은 꽤 중요하다. 애플리케이션의 갑작스런 죽음과는 달리 특정 상황이 발생했고 그 상황에 맞춰 종료코드를 반환하고 죽는다면 그에 대한 대응하기가 수월해진다. 스프링 부트에서 장애대응을 수월하게 할 수 있도록 특정상황에 따른 종료코드(Exit Code)를 반환하며 애플리케이션을 정상종료 시키는 기능을 제공한다.
import org.junit.Before; | |
import org.junit.Test; | |
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | |
import org.springframework.security.crypto.factory.PasswordEncoderFactories; | |
import org.springframework.security.crypto.password.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static org.assertj.core.api.Assertions.assertThat; |
/** * The version number associated with this {@code UUID}. The version * number describes how this {@code UUID} was generated. * * The version number has the following meaning: * <ul> * <li>1 Time-based UUID * <li>2 DCE security UUID
``` | |
@RunWith(SpringRunner.class) | |
@SpringBootTest | |
public class TestConfigurationTest { | |
@TestConfiguration | |
static class InnerTestConfig { | |
@Bean | |
RestTemplate restTemplate() { |
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.honeymon.springboot.boot</groupId> | |
<artifactId>boot-spring-boot</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>war</packaging> |
// `build.gradle` for `boot-spring-boot` | |
plugins { | |
id 'java' | |
id 'war' | |
id 'eclipse' | |
id 'idea' | |
id 'org.springframework.boot' version '1.5.8.RELEASE' | |
id "com.gorylenko.gradle-git-properties" version "1.4.17" | |
} |