Class TestController

java.lang.Object
com.Server.controller.TestController

@RestController
@RequestMapping("/test")
@CrossOrigin
public class TestController
extends java.lang.Object
TestController is use to check whether Server is running and check role user work.
Since:
2020-12-29.
Version:
1.0.
Author:
Krystian Cwioro Kamil Bieniasz Damian Mierzynski.
  • Constructor Summary

    Constructors
    Constructor Description
    TestController()  
  • Method Summary

    Modifier and Type Method Description
    MessageResponse adminAccess()
    This method return text for admin.
    java.lang.String allAccess()
    This method return text for all user.
    MessageResponse userAccess()
    This method return text for user and admin.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestController

      public TestController()
  • Method Details

    • allAccess

      @GetMapping("/all") public java.lang.String allAccess()
      This method return text for all user. This method use endpoint /test/all.
      Returns:
      Text Public Content.
    • userAccess

      @GetMapping("/user") @PreAuthorize("hasRole(\'USER\') or hasRole(\'ADMIN\')") public MessageResponse userAccess()
      This method return text for user and admin. This method use endpoint /test/user.
      Returns:
      Text User Content.
    • adminAccess

      @GetMapping("/admin") @PreAuthorize("hasRole(\'ADMIN\')") public MessageResponse adminAccess()
      This method return text for admin. This method use endpoint /test/admin.
      Returns:
      Text Admin Board.