-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
514 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
heylogs-api/src/test/java/tests/heylogs/spi/ForgeAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package tests.heylogs.spi; | ||
|
||
import lombok.NonNull; | ||
import nbbrd.heylogs.spi.Forge; | ||
|
||
import static internal.heylogs.URLExtractor.urlOf; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatNullPointerException; | ||
|
||
public final class ForgeAssert { | ||
|
||
private ForgeAssert() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
|
||
@SuppressWarnings("DataFlowIssue") | ||
public static void assertForgeCompliance(@NonNull Forge x) { | ||
assertThat(x.getForgeId()) | ||
.matches(nbbrd.heylogs.spi.ForgeLoader.ID_PATTERN); | ||
|
||
assertThat(x.getForgeName()) | ||
.isNotEmpty() | ||
.isNotNull(); | ||
|
||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.isCompareLink(null)); | ||
|
||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.getProjectURL(null)); | ||
|
||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.deriveCompareLink(null, "")); | ||
|
||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.deriveCompareLink(urlOf("http://localhost"), null)); | ||
|
||
assertThat(x.getClass()) | ||
.isFinal(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
heylogs-api/src/test/java/tests/heylogs/spi/ForgeLinkAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package tests.heylogs.spi; | ||
|
||
import lombok.NonNull; | ||
import nbbrd.heylogs.spi.ForgeLink; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public final class ForgeLinkAssert { | ||
|
||
private ForgeLinkAssert() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
|
||
public static void assertForgeLinkCompliance(@NonNull ForgeLink x) { | ||
assertThat(x.getBase()) | ||
.isNotNull(); | ||
|
||
assertThat(x.getClass()) | ||
.isFinal(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
heylogs-api/src/test/java/tests/heylogs/spi/ForgeRefAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package tests.heylogs.spi; | ||
|
||
import lombok.NonNull; | ||
import nbbrd.heylogs.spi.ForgeRef; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatNullPointerException; | ||
|
||
public final class ForgeRefAssert { | ||
|
||
private ForgeRefAssert() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
|
||
@SuppressWarnings("DataFlowIssue") | ||
public static void assertForgeRefCompliance(@NonNull ForgeRef<?> x) { | ||
assertThatNullPointerException() | ||
.isThrownBy(() -> x.isCompatibleWith(null)); | ||
|
||
assertThat(x.getClass()) | ||
.isFinal(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.github.nbbrd.heylogs</groupId> | ||
<artifactId>heylogs-parent</artifactId> | ||
<version>0.8.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>heylogs-ext-github</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<!-- compile only --> | ||
<dependency> | ||
<groupId>org.checkerframework</groupId> | ||
<artifactId>checker-qual</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.nbbrd.java-design-util</groupId> | ||
<artifactId>java-design-processor</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.nbbrd.java-service-util</groupId> | ||
<artifactId>java-service-processor</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- compile and runtime --> | ||
<dependency> | ||
<artifactId>heylogs-api</artifactId> | ||
<groupId>${project.groupId}</groupId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- test only --> | ||
<dependency> | ||
<artifactId>heylogs-api</artifactId> | ||
<groupId>${project.groupId}</groupId> | ||
<version>${project.version}</version> | ||
<classifier>tests</classifier> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
2 changes: 1 addition & 1 deletion
2
.../java/internal/heylogs/github/GitHub.java → ...java/nbbrd/heylogs/ext/github/GitHub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...l/heylogs/github/GitHubCommitSHALink.java → ...ylogs/ext/github/GitHubCommitSHALink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...al/heylogs/github/GitHubCommitSHARef.java → ...eylogs/ext/github/GitHubCommitSHARef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nal/heylogs/github/GitHubCompareLink.java → ...heylogs/ext/github/GitHubCompareLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ernal/heylogs/github/GitHubIssueLink.java → ...d/heylogs/ext/github/GitHubIssueLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ternal/heylogs/github/GitHubIssueRef.java → ...rd/heylogs/ext/github/GitHubIssueRef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nal/heylogs/github/GitHubMentionLink.java → ...heylogs/ext/github/GitHubMentionLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rnal/heylogs/github/GitHubMentionRef.java → .../heylogs/ext/github/GitHubMentionRef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../internal/heylogs/github/GitHubRules.java → ...nbbrd/heylogs/ext/github/GitHubRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.