Reformatted with STS
This commit is contained in:
parent
65f1d7571d
commit
87ca83160e
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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>
|
||||
|
||||
|
@ -9,16 +9,21 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@SpringBootApplication @RestController public class ConfigClient {
|
||||
@Value("${user.role}") private String role;
|
||||
@SpringBootApplication
|
||||
@RestController
|
||||
public class ConfigClient {
|
||||
@Value("${user.role}")
|
||||
private String role;
|
||||
|
||||
@Value("${user.password}") private String password;
|
||||
@Value("${user.password}")
|
||||
private String password;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConfigClient.class, args);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/whoami/{username}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE) public String whoami(@PathVariable("username") String username) {
|
||||
@RequestMapping(value = "/whoami/{username}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String whoami(@PathVariable("username") String username) {
|
||||
return String.format("Hello %s! You are a(n) %s and your password is '%s'.\n", username, role, password);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,11 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = ConfigClient.class) @WebAppConfiguration public class ConfigClientTests {
|
||||
@Test public void contextLoads() {
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = ConfigClient.class)
|
||||
@WebAppConfiguration
|
||||
public class ConfigClientTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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>
|
||||
|
||||
|
@ -5,7 +5,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.config.server.EnableConfigServer;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
|
||||
@SpringBootApplication @EnableConfigServer @EnableWebSecurity public class ConfigServer {
|
||||
@SpringBootApplication
|
||||
@EnableConfigServer
|
||||
@EnableWebSecurity
|
||||
public class ConfigServer {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConfigServer.class, args);
|
||||
}
|
||||
|
@ -6,7 +6,11 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = ConfigServer.class) @WebAppConfiguration public class ConfigServerTests {
|
||||
@Test public void contextLoads() {
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = ConfigServer.class)
|
||||
@WebAppConfiguration
|
||||
public class ConfigServerTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user