Spring Security开发安全的REST服务-学习笔记(3.11-3.12)

Spring Security开发安全的REST服务-学习笔记(3.11-3.12)

  • 欢迎
    • 3-11 使用Swagger自动生成文档
    • 3-12 使用WireMock伪造REST服务

欢迎

本篇博文仅记录该学习过程。

3-11 使用Swagger自动生成文档

1.在项目pom文件中添加依赖

<dependency>
    <groupId>io.springfoxgroupId>
    <artifactId>springfox-swagger2artifactId>
    <version>2.9.2version>
dependency>

<dependency>
    <groupId>io.springfoxgroupId>
    <artifactId>springfox-swagger-uiartifactId>
    <version>2.9.2version>
dependency>

2.在项目启动类中添加@EnableSwagger2注解

package com.lwj.securitydemo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * demo 启动类
 *
 * @author lwj
 */
@SpringBootApplication
@EnableSwagger2
public class SecurityDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(SecurityDemoApplication.class, args);
    }

}

3-12 使用WireMock伪造REST服务

你可能感兴趣的:(Spring Security开发安全的REST服务-学习笔记(3.11-3.12))