minor cleanup work
This commit is contained in:
parent
df2a789fa2
commit
be4c05ad2d
|
@ -15,7 +15,6 @@
|
||||||
<version>1.2.3.RELEASE</version>
|
<version>1.2.3.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class CustomEndpoint implements Endpoint<List<String>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> invoke() {
|
public List<String> invoke() {
|
||||||
//Your logic to display the output
|
// Your logic to display the output
|
||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
messages.add("This is message 1");
|
messages.add("This is message 1");
|
||||||
messages.add("This is message 2");
|
messages.add("This is message 2");
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.baeldung.main;
|
package org.baeldung.main;
|
||||||
|
|
||||||
|
|
||||||
import org.baeldung.service.LoginService;
|
import org.baeldung.service.LoginService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
|
@ -11,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@EnableAutoConfiguration
|
@EnableAutoConfiguration
|
||||||
@ComponentScan({"org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx"})
|
@ComponentScan({ "org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx" })
|
||||||
public class SpringBootActuatorApplication {
|
public class SpringBootActuatorApplication {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -16,13 +16,10 @@ public class LoginServiceImpl implements LoginService {
|
||||||
|
|
||||||
public boolean login(String userName, char[] password) {
|
public boolean login(String userName, char[] password) {
|
||||||
boolean success;
|
boolean success;
|
||||||
if (userName.equals("admin") && "secret".toCharArray().equals(password))
|
if (userName.equals("admin") && "secret".toCharArray().equals(password)) {
|
||||||
{
|
|
||||||
counterService.increment("counter.login.success");
|
counterService.increment("counter.login.success");
|
||||||
success = true;
|
success = true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
counterService.increment("counter.login.failure");
|
counterService.increment("counter.login.failure");
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue