Expect some issues, but there's none

I would like to ask, how do I write test code?

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/shiro")
public class MyShiroCheck {

  @RequiresRoles("admin")
  @GetMapping("/admin/dashboard")
  public String adminPage() {
    return "admin/dashboard";
  }

  public String adminTest() { // Noncompliant{{@RequiresRoles}}
    return "admin/test";
  }
}

Hi,

I’m a bit confused. Are you really asking how to write tests? That’s a bit out of scope for us. Or are you asking why no issues were raised on your tests in SonarQube for IDE? If the latter, please specify your IDE flavor and version, as well as your SonarQube for IDE version.

 
Thx,
Ann