Skip to content

Commit

Permalink
Add test coverage report.
Browse files Browse the repository at this point in the history
  • Loading branch information
sutra committed Nov 27, 2021
1 parent 1bea66e commit 7cc9bc0
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
33 changes: 33 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<module>spring-security-wechat-web</module>
<module>spring-security-wechat-config</module>
<module>spring-security-wechat-samples</module>
<module>spring-security-wechat-coverage</module>
</modules>
<build>
<plugins>
Expand All @@ -39,6 +40,24 @@
<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand All @@ -57,6 +76,13 @@
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<show>private</show>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
Expand All @@ -70,6 +96,13 @@
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions spring-security-wechat-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<name>Spring Security WeChat Core</name>
<description>Spring Security WeChat Core.</description>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.oxerr.spring.security.wechat.core;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Locale;

import org.junit.jupiter.api.Test;

class WeChatMessageSourceTest {

@Test
void testGetAccessor() {
assertEquals("User denied.",
WeChatMessageSource.getAccessor()
.getMessage("WeChatAuthenticationProvider.authdeny", Locale.ENGLISH)
);
}

}
55 changes: 55 additions & 0 deletions spring-security-wechat-coverage/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.oxerr.spring.security</groupId>
<artifactId>spring-security-wechat</artifactId>
<version>0.0.3</version>
</parent>
<artifactId>spring-security-wechat-coverage</artifactId>
<name>Spring Security WeChat Coverage</name>
<description>Compute aggregated test code coverage.</description>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-wechat-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-wechat-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-wechat-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-wechat-samples-helloworld</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>report-aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>

0 comments on commit 7cc9bc0

Please sign in to comment.