08 2023 档案
摘要:参考 https://blog.csdn.net/qq_41497111/article/details/96426824 {"store":{"book":[{"category":"reference","author":"Nigel Rees","title":"Sayings of the
阅读全文
摘要:controller package com.example.file.controller; import com.example.file.utils.FileUtil; import org.springframework.beans.factory.annotation.Autowired;
阅读全文
摘要:查看官网:https://docs.qameta.io/allure/#_junit_5 源码example: https://github.com/allure-examples/allure-examples/tree/master/allure-junit5/src/test/java/io/
阅读全文
摘要:命令格式: allure [option] [command] [command options] allure --help 帮助 allure --version 查看版本信息 allure serve 生成在线版本的测试 allure generate <allure-result中间文件>
阅读全文
摘要:1、安装 Java (推荐 1.8 版本),需要配置环境变量2、安装 Allure (2.13以上版本),需要配置环境变量 【下载地址】 https://repo1.maven.org/maven2/io/qameta/allure/allure-commandline/ mac/linux: 下载
阅读全文
摘要:给用例添加禁用标识,被禁用的用例执行后会添加跳过的状态,可以禁用测试类、也可以禁用测试方法 注意:IDEA 不支持,maven 构建才支持 import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import
阅读全文
摘要:通过 Tag 对用例分组: 环境分组: 测试环境、预发布环境 阶段分组: 冒烟用例 版本分组: V1.1、V1.2 设置标签 根据标签执行 结合 Maven 执行 结合测试套件执行 import org.junit.jupiter.api.Tag; import org.junit.jupiter.
阅读全文
摘要:import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.RepeatedTest; import org.junit.jupiter.api.Test; public class RepeatedExampleTe
阅读全文
摘要:排序方式 方法排序 类排序 Suite 方法排序的类型 类型说明 OrderAnnotation(重点) @Order 注解指定排序 DisplayName 根据显示名称排序 Random 随机排序 MethodName 根据方法名称排序 import org.junit.jupiter.api.M
阅读全文
摘要:package com.mytest; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; public class NestedExampleTest { @Nested //需要结合class使用 cla
阅读全文
摘要:import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import static java.lang.Thread.sleep
阅读全文
摘要:自动化测试过程中,需要验证某些特殊场景时,需要传空或者传null null 参数的参数化注解 @NullSource 注解 参数为空的参数化注解 @EmptySource 注解 需要 null 和空都进行参数化,使用 @NullAndEmptySource 注解 还有其他参数可以用@ValueSou
阅读全文
摘要:使用枚举类作为测试数据。 枚举参数参数化注解 @EnumSource。 必须与 @ParameterizedTest 结合使用。 需要添加@EnumSource注解 测试方法传入枚举类作为参数 package com.mytest; import org.junit.jupiter.params.P
阅读全文
摘要:通过@MethodSource注解引用方法作为参数化的数据源信息 在 @MethodSource 注解的参数必须是静态的工厂方法,除非测试类被注释为@TestInstance(Lifecycle.PER_CLASS) 静态工厂方法的返回值需要和测试方法的参数对应 如果在 @MethodSource
阅读全文
摘要:多参数参数化注解 @CsvSource。 @CsvSource 通过指定的分隔符实现参数化。 package com.mytest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.
阅读全文
摘要:引入依赖 <!-- 参数化依赖--> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> <version>5.8.1</version> <scope>tes
阅读全文
摘要:package com.mytest; import org.junit.jupiter.api.*; import static org.junit.jupiter.api.Assertions.assertEquals; public class Case2Test { //前置条件,只执行一次
阅读全文
摘要:package com.mytest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; pub
阅读全文
摘要:<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc
阅读全文
摘要:工具计算(PS或者FW) 以fw为例,按照2倍图缩放 1.导入图片后,选中图片,下方显示整张图片的尺寸大小(208x655) 2.修改宽大小为原来的一半:104 回车 3.测量图标大小(23x23),坐标为(59x194) 相关代码 <body> <div class="search-index">
阅读全文
摘要:flex布局原理 flex 是 flexible Box 的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性,任何一个容器都可以指定为 flex 布局。 当我们为父盒子设为 flex 布局以后,子元素的 float、clear 和 vertical-align 属性将失效。 flex布局又叫伸
阅读全文
摘要:1. 安装 vetur 和 vue-helper 两个插件2. 打开设置 --> 扩展 --> vue helper, 然后在右边找到在 settings.json 中编辑,点击,添加或修改下面的配置: "vue-helper.alias": { "@": "src" }, "vue-helper.
阅读全文
摘要:我们需要自定义一个过滤器,这个过滤器会去获取请求头中的token,对token进行解析取出其中的userid。 使用userid去redis中获取对应的LoginUser对象。 然后封装Authentication对象存入SecurityContextHolder package com.secur
阅读全文
摘要:自定义登陆接口,然后让SpringSecurity对这个接口放行,让用户访问这个接口的时候不用登录也能访问。 在接口中我们通过AuthenticationManager的authenticate方法来进行用户认证,所以需要在SecurityConfig中配置把AuthenticationManage
阅读全文
摘要:默认使用的PasswordEncoder要求数据库中的密码格式为:{id}password 。它会根据id去判断密码的加密方式。但是我们一般不会采用这种方式。所以就需要替换PasswordEncoder。 我们一般使用SpringSecurity为我们提供的BCryptPasswordEncoder
阅读全文
摘要:自定义一个UserDetailsService,让SpringSecurity使用我们的UserDetailsService。我们自己的UserDetailsService可以从数据库中查询用户名和密码 mapper package com.security.mapper; import com.b
阅读全文
摘要:登录 ①自定义登录接口 调用ProviderManager的方法进行认证 如果认证通过生成jwt 把用户信息存入redis中【userId作为Key,用户信息作为Value】 ②自定义UserDetailsService 【因为原本这个接口的实现类是在内存中查询用户信息,不符合我们的
阅读全文
摘要:pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
阅读全文
摘要:import com.alibaba.fastjson.serializer.SerializeConfig; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializ
阅读全文
摘要:统一响应类 import com.fasterxml.jackson.annotation.JsonInclude; import com.sangeng.enums.AppHttpCodeEnum; import java.io.Serializable; @JsonInclude(JsonInc
阅读全文
摘要:1、AND组合关系 thenCombine / thenAcceptBoth / runAfterBoth都表示:「当任务一和任务二都完成再执行任务三」。 区别在于: 「runAfterBoth」 不会把执行结果当做方法入参,且没有返回值 「thenAcceptBoth」: 会将两个任务的执行结果作
阅读全文
摘要:import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; public static void main(String[] args) throws Interrupt
阅读全文
摘要:import com.alibaba.dubbo.common.URL;import com.alibaba.dubbo.common.extension.ExtensionLoader;import com.alibaba.dubbo.registry.Registry;import com.al
阅读全文
摘要:向注册中心写入路由规则: // 获取注册中心的扩展类 RegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.c lass).getAdaptiveExtension(); // 获取注
阅读全文
摘要:1.开启容错后,动态配置里会添加一条容错的配置 2.当服务提供者调用超时,或者关闭服务提供者服务时,则返回null或者你设置的指定json 服务调用失败返回null 指定调用失败的返回结果
阅读全文
摘要:服务提供者:user-service-provider 服务消费者:order-service-consumer 场景一:屏蔽消费者 1.屏蔽后会默认添加一条动态配置 2.发起请求后,提供者的服务默认会返回null 场景二:返回指定的json 1.给消费者新增屏蔽的动态配置 2.消费者无需屏蔽,开启
阅读全文
摘要:springboot整合dubbo引入依赖(导入的2.6.2版本) <dependency> <groupId>com.alibaba.boot</groupId> <artifactId>dubbo-spring-boot-starter</artifactId> <version>0.2.0</
阅读全文
摘要:@ImportResource注解主要用于导入Spring的xml配置文件注册的Bean。 该注解只能使用配置类注解(@Configuration)或者组件注解(@Component)中使用,否则无效。
阅读全文
摘要:参考地址 https://blog.csdn.net/qq_37846607/article/details/130683568
阅读全文
摘要:windows版本 1.修改配置文件 # bind-address = "0.0.0.0:8088" [[graphite]] # Determines whether the graphite endpoint is enabled. # enabled = true # database = "
阅读全文
摘要:jmeter -n -t [jmx file] -l [result file] -e -o [path to web report folder] jmeter 是命令名称 -n :non gui 启用cli模式 -t: 测试计划,jmx脚本名称,可以带路径。(默认路径是jmeter的bin路径。
阅读全文