Skip to content

spring-boot and spring-security and spring-data rest example

Notifications You must be signed in to change notification settings

ixkormachev/spring-boot-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

THIS SAMPLE APPLICATION SHOWS SEVERAL USEFULL FEATURES:

  1. spring boot
  2. spring security
  3. spring data rest
  4. MockMvc
  5. mysql/h2 (dev/test) use

NB: main rest services feature could be seen through:

  1. tests (RestControllerTest.java) no external db is needed
  2. or using external mysql db; sql scripts could be found here:

/spring-boot-ex2/src/main/resources/static/db/ ...

APP RUN

  1. mvn clean package
  2. if using external db, set mysql and run db_structure.sql and insert_roles.sql

java -jar target\spring-boot-ex2-0.0.1-SNAPSHOT.jar

TESTING WITH CURL

curl -H "Content-Type: application/json" -X POST -d '{"id":null,"email":"[email protected]","password":"password2","name":"user2","lastName":"lastName2","active":1,"roles":["ADMIN"]}' http://localhost:8080/registration

curl http://localhost:8080/user

curl -w "%{http_code}" -H "Content-Type: application/json" -H "Authorization: Basic dGVzdDJAdGVzdC5jb206cGFzc3dvcmQy" -X POST -d '{"result":"process me, please"}' http://localhost:8080/process

About

spring-boot and spring-security and spring-data rest example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages