Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Commit

Permalink
Impoved Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalijr2 committed Oct 24, 2024
1 parent ce06ba5 commit 43fae26
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@
</plugin>
</plugins>
</build>
<ciManagement>
<system>GitHub Actions</system>
<url>https://github.com/vitalijr2/mock-jdk-platform-logging/actions</url>
</ciManagement>
<dependencies>
<dependency>
<artifactId>mockito-core</artifactId>
Expand Down Expand Up @@ -341,6 +345,10 @@
</developers>
<groupId>io.github.vitalijr2.logging</groupId>
<inceptionYear>2024</inceptionYear>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/vitalijr2/mock-jdk-platform-logging/issues</url>
</issueManagement>
<licenses>
<license>
<comments>See NOTICE for third-party licenses.</comments>
Expand Down Expand Up @@ -432,8 +440,8 @@
<properties>
<java.version>11</java.version>
<javadoc-plugin.version>3.10.1</javadoc-plugin.version>
<junit-platform.version>1.11.3</junit-platform.version>
<junit-jupiter.version>5.11.3</junit-jupiter.version>
<junit-platform.version>1.11.3</junit-platform.version>
<mockito.version>5.14.2</mockito.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@
/**
* jUnit extension to clean and reset mock loggers. Clean and reset mock loggers before and after tests. You are still
* able to run tasks in {@link org.junit.jupiter.api.BeforeEach} and {@link org.junit.jupiter.api.AfterEach}.
* <p>
* Example:
* <pre><code class="language-java">
* {@literal @}ExtendWith(MockLoggerExtension.class)
* class HelloServiceExtensionTest {
*
* private static Logger logger;
*
* {@literal @}BeforeAll
* static void setUpClass() {
* logger = System.getLogger("HelloService");
* }
*
* {@literal @}DisplayName("Names")
* {@literal @}ParameterizedTest(name = "&lt;{0}&gt;")
* {@literal @}ValueSource(strings = {"John", "Jane"})
* void names(String name) {
* var helloService = new HelloService();
*
* assertDoesNotThrow(() -> helloService.sayHello(name));
*
* var logger = System.getLogger("HelloService");
*
* verify(logger).log(Level.INFO, "Hello " + name + "!");
* verifyNoMoreInteractions(logger);
* }
*
* }
* </code></pre>
*
* @since 1.1.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@

/**
* Uses {@link org.mockito.Mockito#mock(Class, String)} to get a mock that is adapted for {@link Logger}.
* <p>
* Example:
* <pre><code class="language-java">
* {@literal @}Test
* void helloWorld() {
* var helloService = new HelloService();
*
* assertDoesNotThrow(helloService::sayHelloWorld);
*
* verify(System.getLogger("HelloService")).log(Level.INFO, "Hello World!");
* }
* </code></pre>
*
* @since 1.0.0
*/
Expand Down
12 changes: 8 additions & 4 deletions src/main/javadoc/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
<a href="https://app.codacy.com/gh/vitalijr2/mock-jdk-platform-logging/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img
alt="Codacy Badge" src="https://app.codacy.com/project/badge/Grade/9be380deaf3e40138ad306a40532289c"></a>
<a href="https://app.codacy.com/gh/vitalijr2/mock-jdk-platform-logging/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage"><img
alt="Codacy Coverage" src="https://app.codacy.com/project/badge/Coverage/9be380deaf3e40138ad306a40532289c"></a>
<a href="https://libraries.io/github/vitalijr2/mock-jdk-platform-logging"><img
alt="Libraries.io dependency status for GitHub repo"
src="https://img.shields.io/librariesio/github/vitalijr2/mock-jdk-platform-logging"></a>
alt="Codacy Coverage"
src="https://app.codacy.com/project/badge/Coverage/9be380deaf3e40138ad306a40532289c"></a><br>
<a href="https://www.oracle.com/java/technologies/downloads/#java11"><img
alt="Java Version"
src="https://img.shields.io/static/v1?label=java&message=11&color=blue&logo=java&logoColor=E23D28"></a>
<img alt="jUnit Jupiter Version"
src="https://img.shields.io/static/v1?label=jUnit+Jupiter&message=5.11.3&color=blue&logo=junit5&logoColor=E23D28">
<img alt="jUnit Platform Version"
src="https://img.shields.io/static/v1?label=jUnit+Platform&message=1.11.3&color=blue&logo=junit5&logoColor=E23D28">
<img alt="Mockito Version"
src="https://img.shields.io/static/v1?label=Mockito&message=5.14.2&color=blue&logoColor=E23D28">
</p>
<p>
The most basic usage example looks like this:
Expand Down

0 comments on commit 43fae26

Please sign in to comment.