← All Spring Framework Flashcard Decks

Spring Security & Testing Flashcards

6 cards from real Spring Framework practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Spring Security & Testing flashcards as text
  1. What is the default login URL provided by Spring Security's form login feature?

    Answer: /login

    Spring Security auto-generates a /login page when form login is enabled and no custom login page is configured.

  2. Which annotation enables Spring Security's method-level security?

    Answer: @EnableMethodSecurity

    @EnableMethodSecurity (Spring Security 5.6+) activates method-level annotations like @PreAuthorize, @PostAuthorize, and @Secured.

  3. What does the @PreAuthorize annotation do in Spring Security?

    Answer: Evaluates a SpEL expression before a method is invoked to check authorization

    @PreAuthorize evaluates a Spring Expression Language (SpEL) authorization expression before the target method executes, denying access if it returns false.

  4. In Spring Security, what is a GrantedAuthority?

    Answer: A permission or role assigned to a user

    GrantedAuthority represents a permission or role (e.g., ROLE_ADMIN) granted to a principal, used in access control decisions.

  5. What Spring Security class is used to encode passwords before storing them?

    Answer: PasswordEncoder

    PasswordEncoder is the interface Spring Security uses for one-way password encoding; BCryptPasswordEncoder is the recommended implementation.

  6. What HTTP status does Spring Security return by default when an unauthenticated user accesses a protected resource?

    Answer: 302 Redirect to login

    By default, Spring Security redirects unauthenticated users to the login page (HTTP 302) rather than returning a 401 directly.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. docs.broadcom.com — Test delivery, retake policy, exam information · verified Oct 2026
  2. spring-academy.broadcom.com — Eligibility · verified Oct 2026
  3. broadcom.com — Fees, exam format, passing score, time limit · verified Oct 2026