From ca42b231a46c04793ead299e2c310626490fccd3 Mon Sep 17 00:00:00 2001 From: Teletha Date: Mon, 14 Oct 2024 05:45:22 +0900 Subject: [PATCH] fix: test Library --- src/main/java/bee/api/Library.java | 4 +-- src/test/java/bee/api/LibraryTest.java | 39 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/test/java/bee/api/LibraryTest.java diff --git a/src/main/java/bee/api/Library.java b/src/main/java/bee/api/Library.java index 151f5b949..02ba267dc 100644 --- a/src/main/java/bee/api/Library.java +++ b/src/main/java/bee/api/Library.java @@ -193,7 +193,7 @@ public File getLocalJavadocJar() { * * @return */ - public String getPOM() { + String getPOM() { return localPath(".pom"); } @@ -202,7 +202,7 @@ public String getPOM() { * * @return */ - public File getLocalPOM() { + File getLocalPOM() { return I.make(Repository.class).getLocalRepository().file(getPOM()); } diff --git a/src/test/java/bee/api/LibraryTest.java b/src/test/java/bee/api/LibraryTest.java new file mode 100644 index 000000000..87f325eb8 --- /dev/null +++ b/src/test/java/bee/api/LibraryTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 Nameless Production Committee + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://opensource.org/licenses/mit-license.php + */ +package bee.api; + +import org.junit.jupiter.api.Test; + +public class LibraryTest { + + @Test + void jar() { + Library library = new Library("group", "test", "1.0"); + assert library.getJar().equals("group/test/1.0/test-1.0.jar"); + } + + @Test + void javadocJar() { + Library library = new Library("group", "test", "1.0"); + assert library.getJavadocJar().equals("group/test/1.0/test-1.0-javadoc.jar"); + } + + @Test + void sourceJar() { + Library library = new Library("group", "test", "1.0"); + assert library.getSourceJar().equals("group/test/1.0/test-1.0-sources.jar"); + } + + @Test + void pom() { + Library library = new Library("group", "test", "1.0"); + assert library.getPOM().equals("group/test/1.0/test-1.0.pom"); + } +}