乙巳🐍年

acc8226 的博客

1
2
3
4
dependencies {
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
}

实际生产中,我们往往需要 slf4j + log4j2 进行日志管理;就需要导入 slf4j 日志门面、log4j2 适配器;然后使用 slf4j 方法接口名称来输出日志。

log4j-slf4j-impl should be used with SLF4J 1.7.x releases or older.

1
2
3
dependencies {
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.20.0'
}
阅读全文 »

Mockito framework site
https://site.mockito.org/

Mockito 是 mocking 框架,它让你用简洁的 API 做测试。而且 Mockito 简单易学,它可读性强和验证语法简洁。

Mockito教程 - 明-Ming - 博客园
https://www.cnblogs.com/Ming8006/p/6297333.html

除了核心包还需要 3 个 jar 包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.0</version>
<dependencies>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
...
0%