Monthly Archive: 10월 2018

springboot security 예제

spring.security.user.name=user spring.security.user.password=1234   package com.htrucci.bootsecurity; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class BootsecurityApplication { public static void main(String[] args) { SpringApplication.run(BootsecurityApplication.class, args); } } @RestController class...

SpringBoot + Junit 예제

SpringBoot + Junit 예제 import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class BootrestApplicationTests { @Autowired private TestRestTemplate restTemplate; @Test public void testSpringBootApp() throws JsonProcessingException, IOException{ String body = restTemplate.getForObject(“/”,...