сейчас я скину тебе контроллер на который нужно будет написать тесты, но тесты нужно писать в таком же стиле в котором мы писали на уроке, вот код с урока

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureMockMvc
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
public class TeacherControllerTest {
    @Autowired
    private TeacherStorageTestImpl teacherStorage;
    private final RequestSpecification requestSpecification = new RequestSpecBuilder()
            .setBasePath("/school/teacher")
            .setContentType(ContentType.JSON)
            .log(LogDetail.ALL)
            .build();
    private final ResponseSpecification responseSpecification = new ResponseSpecBuilder()
            .log(LogDetail.ALL)
            .build();

    @Test
    @DisplayName("Получение всех учителей")
    public void getAllSuccess() {
        List<TeacherDto> teacherDtos = given(requestSpecification)
                .get()
                .then()
                .spec(responseSpecification)
                .statusCode(200)
                .extract()
                .body()
                .as(new TypeRef<>() {});

        assertEquals(1, teacherDtos.size());
        TeacherDto teacherDto = teacherDtos.get(0);
        assertEquals("ivan", teacherDto.getName());
        assertEquals("ivanov", teacherDto.getLastName());
        assertEquals("ivanovich", teacherDto.getSecondName());
        assertEquals("physics", teacherDto.getSubject());
    }

    @Test
    @DisplayName("Получение всех учителей")
    public void getAllEmptySuccess() {
        teacherStorage.getData().clear();
        String response = given(requestSpecification)
                .get()
                .then()
                .contentType(ContentType.TEXT)
                .log().all()
                .statusCode(200)
                .extract()
                .body()
                .asPrettyString();
        Assertions.assertEquals("Нет учителей!", response);
    }

    @Test
    @DisplayName("Получение учителя по id")
    public void getTeacherByIdSuccess() {
        TeacherDto result = given(requestSpecification)
                .get("/1")
                .then()
                .spec(responseSpecification)
                .statusCode(200)
                .extract()
                .body()
                .as(TeacherDto.class);

        assertEquals("ivan", result.getName());
        assertEquals("ivanov", result.getLastName());
        assertEquals("ivanovich", result.getSecondName());
        assertEquals("physics", result.getSubject());
    }

    @Test
    @DisplayName("Удаление учителя по id")
    public void deleteTeacherIdSuccess() {
        Boolean result = given(requestSpecification)
                .delete("/1")
                .then()
                .spec(responseSpecification)
                .statusCode(200)
                .extract()
                .body()
                .as(Boolean.class);

        assertTrue(result);
        assertFalse(teacherStorage.getData().containsKey(1));
    }

    @Test
    @DisplayName("Создание учителя")
    public void createTeacherSuccess() {
        TeacherDto teacherDto = TeacherDto.builder()
                .id(null)
                .name("aleksandr")
                .secondName("radionovich")
                .lastName("radionov")
                .subject("mathematics")
                .build();

        given(requestSpecification)
                .body(teacherDto)
                .post()
                .then()
                .spec(responseSpecification)
                .statusCode(201)
                .body("name", equalTo("aleksandr"))
                .body("second_name", equalTo("radionovich"))
                .body("last_name", equalTo("radionov"))
                .body("subject", equalTo("mathematics"))
                .body("id", equalTo(2));
    }

    @Test
    @DisplayName("Обновление предмета учителя")
    public void updateTeacherSuccess() {
        TeacherDto requestDto = TeacherDto.builder()
                .id(1)
                .subject("mathematics")
                .build();
        given(requestSpecification)
                .body(requestDto)
                .patch()
                .then()
                .spec(responseSpecification)
                .statusCode(202)
                .body("name", equalTo("ivan"))
                .body("second_name", equalTo("ivanovich"))
                .body("last_name", equalTo("ivanov"))
                .body("subject", equalTo("mathematics"))
                .body("id", equalTo(1));

        TeacherDto teacherDto = teacherStorage.getData().get(1);
        assertEquals("mathematics", teacherDto.getSubject());
    }

@Component
public class TeacherStorageTestImpl implements TeacherStorage {
    private final Map<Integer, TeacherDto> data = new HashMap<>();
    private final AtomicInteger counter = new AtomicInteger();

    @PostConstruct
    public void init() {
        TeacherDto teacherDto = TeacherDto.builder()
                .id(1)
                .name("ivan")
                .secondName("ivanovich")
                .lastName("ivanov")
                .subject("physics")
                .build();
        data.put(1, teacherDto);
        counter.addAndGet(1);
    }


    @Override
    public Map<Integer, TeacherDto> getData() {
        return data;
    }

    @Override
    public AtomicInteger getCounter() {
        return counter;
    }
}

@Component
@Profile("prom")
public class TeacherStorageImpl {
    private final Map<Integer, TeacherDto> data = new HashMap<>();
    private final AtomicInteger counter = new AtomicInteger();

    public Map<Integer, TeacherDto> getData() {
        return this.data;
    }

    public AtomicInteger getCounter() {
        return this.counter;
    }
}


public interface TeacherStorage {

    Map<Integer, TeacherDto> getData();

    AtomicInteger getCounter();
}



@Data
@Schema(description = "Учитель")
@Builder
public class TeacherDto {
    private Integer id;

    @Schema(description = "Имя")
    private String name;

    @JsonProperty("second_name")
    @Schema(description = "Отчество")
    private String secondName;

    @JsonProperty("last_name")
    @Schema(description = "Фамилия")
    private String lastName;

    //Предмет
    @Schema(description = "Предмет")
    private String subject;
}
@RestController
@RequestMapping("/school/teacher")
@Tag(name = "Teacher controller", description = "Контроллер для работы с школьными учителями")
@RequiredArgsConstructor
public class TeacherController {
    private final TeacherStorage teacherStorage;

    @GetMapping
    @Operation(tags = "Получение учителей", summary = "Получение учителей", description = "Получение всех учителей школы")
    @ApiResponse(responseCode = "200 - Успешно", content = {
            @Content(mediaType = "plain/text", schema = @Schema(implementation = String.class)),
            @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = TeacherDto.class)))
    })
    public ResponseEntity<?> getAll() {
        //CRUD - CREATE READ UPDATE DELETE
        //API - application programming interface
        if (teacherStorage.getData().isEmpty()) {
            return ResponseEntity.ok("Нет учителей!");
        }
        return ResponseEntity.ok(new ArrayList<>(teacherStorage.getData().values()));
    }

    @GetMapping("/{id}")
    public TeacherDto getById(@PathVariable @Parameter(description = "id учителя") Integer id) {
        return teacherStorage.getData().get(id);
    }

    @PostMapping
    @ResponseStatus(code = HttpStatus.CREATED)
    public TeacherDto create(@RequestBody TeacherDto dto) {
        teacherStorage.getCounter().addAndGet(1);
        dto.setId(teacherStorage.getCounter().get());
        teacherStorage.getData().put(teacherStorage.getCounter().get(), dto);
        return dto;
    }

    @DeleteMapping("/{id}")
    public boolean deleteById(@PathVariable Integer id) {
        return teacherStorage.getData().remove(id) != null;
    }

    @PatchMapping
    @ResponseStatus(value = HttpStatus.ACCEPTED)
    public TeacherDto update(@RequestBody TeacherDto newDto) {
        if (!teacherStorage.getData().containsKey(newDto.getId())) {
            throw new RuntimeException("Нет учителя с таким id: %s".formatted(newDto.getId()));
        }
        TeacherDto oldDto = teacherStorage.getData().get(newDto.getId());
        return update(oldDto, newDto);
    }

    private TeacherDto update(TeacherDto oldDto, TeacherDto newDto) {
        oldDto.setName(newDto.getName() != null ? newDto.getName() : oldDto.getName());
        oldDto.setSecondName(newDto.getSecondName() != null ? newDto.getSecondName() : oldDto.getSecondName());
        oldDto.setLastName(newDto.getLastName() != null ? newDto.getLastName() : oldDto.getLastName());
        oldDto.setSubject(newDto.getSubject() != null ? newDto.getSubject() : oldDto.getSubject());
        return oldDto;
    }

}

а сейчас скину контроллер на который нужно написать тесты


@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
@Tag(name = "Контроллер для работы с пользователем", description = "Возможность создать пользователя"
        + " а также сменить пароль")
public class UserController {
    private final UserService service;
    private static final int CREATED_STATUS = 201;

    @Operation(
            summary = "Регистрация пользователя",
            description = "Регистрация и сохранение нового пользователя")
    @ApiResponses({
            @ApiResponse(
                    responseCode = "201",
                    description = "Пользователь зарегистрирован"
            ),
            @ApiResponse(
                    responseCode = "400",
                    description = "Логин занят",
                    content = @Content(
                            mediaType = "application/json",
                            schema = @Schema(implementation = ExceptionDto.class)
                    )
            )
    })
    @PostMapping("/signup")
    @ResponseStatus(HttpStatus.CREATED)
    public ResponseEntity<UserDto> signup(@RequestBody UserDto user) {
        service.saveNewUser(user);
        return ResponseEntity.status(CREATED_STATUS).body(user);
    }


    @Operation(summary = "Смена пароля пользователя",
            description = "Изменение пароля пользователя")
    @ApiResponses({
            @ApiResponse(
                    responseCode = "202",
                    description = "Пароль изменен"
            ),
            @ApiResponse(
                    responseCode = "400",
                    description = "Неверный пароль",
                    content = @Content(
                            mediaType = "application/json",
                            schema = @Schema(implementation = ExceptionDto.class)
                    )
            )
    })
    @PostMapping("/reset-password")
    public ResponseEntity<ResetPasswordDto> resetPassword(@RequestBody ResetPasswordDto resetPasswordDto) {
        service.resetPassword(resetPasswordDto.getLogin(),
                resetPasswordDto.getOldPassword(),
                resetPasswordDto.getNewPassword());
        return ResponseEntity.status(200).body(resetPasswordDto);
    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(description = "Дто для смены пароля")
public class ResetPasswordDto {

    @Schema(description = "Логин пользователя")
    @NonNull
    private String login;

    @Schema(description = "Старый пароль")
    @NonNull
    @JsonProperty("old_password")
    private String oldPassword;

    @Schema(description = "Новый пароль")
    @NonNull
    @JsonProperty("new_password")
    private String newPassword;
}

@Service
@RequiredArgsConstructor
public class UserService {
    private final UserRepository repository;
    private final UserMapper mapper;

    public void saveNewUser(UserDto userDto) {
       repository.save(mapper.convertToEntity(userDto));
    }

    public UserEntity getByLogin(String login) {
        return repository.findByLogin(login)
                .orElseThrow(() -> new IllegalArgumentException("Пользователь с таким логином не найден!"));
    }

    public void resetPassword(String login, String oldPassword, String newPassword) {
        UserEntity user = getByLogin(login);

        if (!user.getPassword().equals(oldPassword)) {
            throw new IllegalArgumentException("Неверный пароль!");
        }
        user.setPassword(newPassword);
        repository.update(user);
    }
}

@Component
public class UserStorageImpl {
    @Getter
    private Map<String, UserEntity> data = new HashMap<>();
}


@FunctionalInterface
public interface UserStorage {
    Map<String, UserEntity> getData();
}

ДАВАЙ Я ВЕРЮ В ТЕБЯ

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Дто для создания пользователя")
public class UserDto {

    @Schema(description = "Уникальный логин")
    private String login;

    @Schema(description = "Почта пользователя")
    private String email;

    @Schema(description = "Пароль пользователя")
    private String password;
}