BAEL-2039: chaos monkey for spring boot (#4889)
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
e7485a1813
commit
e80c93b72b
@@ -0,0 +1,15 @@
|
||||
package com.baeldung.chaosmonkey;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* Created by adi on 8/2/18.
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = { "com.baeldung.chaosmonkey" })
|
||||
public class SpringBootChaosMonkeyApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringBootChaosMonkeyApp.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.baeldung.chaosmonkey.controller;
|
||||
|
||||
import com.baeldung.chaosmonkey.service.PermissionsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adi on 8/2/18.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/permissions")
|
||||
public class PermissionsController {
|
||||
|
||||
@Autowired private PermissionsService permissionsService;
|
||||
|
||||
@GetMapping
|
||||
public List<String> getAllPermissions() {
|
||||
return permissionsService.getAllPermissions();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.baeldung.chaosmonkey.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adi on 8/2/18.
|
||||
*/
|
||||
@Service
|
||||
public class PermissionsService {
|
||||
|
||||
public List<String> getAllPermissions() {
|
||||
return Arrays.asList("CREATE", "READ", "UPDATE", "DELETE");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user