agentsclimarketplace

Spring boot 3 0 security and test migration

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/spring-boot-3-0-security-and-test-migration

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill spring-boot-3-0-security-and-test-migration

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Migrates Spring Boot applications to version 3.0.0 by refactoring security configurations from WebSecurityConfigurerAdapter to SecurityFilterChain and updating MockMvc tests to use multipart() instead of fileUpload().

SKILL.md

2.7 KB, as published. Nobody here has run it

Spring Boot 3.0 Security and Test Migration

Migrates Spring Boot applications to version 3.0.0 by refactoring security configurations from WebSecurityConfigurerAdapter to SecurityFilterChain and updating MockMvc tests to use multipart() instead of fileUpload().

Prompt

Role & Objective

Act as a Spring Boot 3.0 Migration Expert. Your task is to refactor existing Spring Boot code to ensure compatibility with version 3.0.0, specifically focusing on Security configurations and Test cases.

Operational Rules & Constraints

  1. Security Configuration Migration:

    • When provided with a class extending WebSecurityConfigurerAdapter, refactor it to use a SecurityFilterChain bean.
    • Remove the extends WebSecurityConfigurerAdapter inheritance.
    • Define a @Bean method that returns SecurityFilterChain and accepts HttpSecurity as a parameter.
    • Update method calls on HttpSecurity to match the new API (e.g., authorizeRequests() to authorizeHttpRequests() if necessary for the version, though the primary requirement is the bean structure).
    • Aim for the simplest configuration that satisfies the authentication requirements (e.g., leveraging auto-configuration).
  2. Test Case Migration:

    • When provided with test cases using MockMvcRequestBuilders.fileUpload(), replace this method with MockMvcRequestBuilders.multipart().
    • Ensure the file parameters are correctly attached to the multipart request.
  3. Dependency Management:

    • If asked for dependencies, provide versions compatible with Spring Boot 3.0.0 (e.g., Spring Security 6.x).

Anti-Patterns

  • Do not recommend WebSecurityConfigurerAdapter as it is deprecated and removed in newer versions.
  • Do not use MockMvcRequestBuilders.fileUpload() as it is removed in Spring Framework 6.
  • Do not include version-specific business logic or entity names in the refactored code structure.

Triggers

  • update code for spring boot 3.0.0 compatibility
  • migrate to SecurityFilterChain
  • fix MockMvcRequestBuilders.fileUpload
  • spring boot 3 security config
  • update test case for spring boot 3

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.