Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing RelationType Adaptation #464

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.katsute</groupId>
<artifactId>mal4j</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>

<profiles>
<profile>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/dev/katsute/mal4j/property/RelationType.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* @see RelatedMedia#getRelationType()
* @since 1.0.0
* @version 2.9.0
* @version 3.4.3
* @author Katsute
*/
public enum RelationType implements FieldEnum {
Expand All @@ -35,6 +35,7 @@ public enum RelationType implements FieldEnum {
Other ("other"),
Sequel ("sequel"),
Prequel ("prequel"),
Adaptation ("adaptation"),
AlternativeSetting ("alternative_setting"),
AlternativeVersion ("alternative_version"),
SideStory ("side_story"),
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import dev.katsute.mal4j.MyAnimeList;
import dev.katsute.mal4j.TestProvider;
import dev.katsute.mal4j.manga.Manga;
import dev.katsute.mal4j.manga.RelatedManga;
import dev.katsute.mal4j.manga.property.MangaPublishStatus;
import dev.katsute.mal4j.manga.property.MangaType;
import dev.katsute.mal4j.property.RelationType;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -36,7 +38,7 @@
if(!method.equals("Serialization#Role"))
assertNotNull(function.apply(manga), "Expected Manga#" + method + " to not be null");
else
assumeTrue(function.apply(manga) != null, "Expected Manga#" + method + " to not be null (external issue)");

Check notice on line 41 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 8)

💤 dev/katsute/mal4j/MangaTests/TestManga testManga(String, Function)[60] :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L41 org.opentest4j.TestAbortedException: Assumption failed: Expected Manga#Serialization#Role to not be null (external issue) at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testManga(TestManga.java:41) at java.lang.reflect.Method.invoke(Method.java:498) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) a

Check notice on line 41 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 11)

💤 dev/katsute/mal4j/MangaTests/TestManga testManga(String, Function)[60] :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L41 org.opentest4j.TestAbortedException: Assumption failed: Expected Manga#Serialization#Role to not be null (external issue) at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testManga(TestManga.java:41) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPi

Check notice on line 41 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 17)

💤 dev/katsute/mal4j/MangaTests/TestManga testManga(String, Function)[60] :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L41 org.opentest4j.TestAbortedException: Assumption failed: Expected Manga#Serialization#Role to not be null (external issue) at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testManga(TestManga.java:41) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPi
}

@SuppressWarnings("unused")
Expand Down Expand Up @@ -144,7 +146,10 @@
assertEquals(MangaPublishStatus.Unknown, MangaPublishStatus.asEnum("?"));
assertEquals(MangaType.Unknown, MangaType.asEnum("?"));

for(final RelatedManga relatedManga : mal.getManga(112589).getRelatedManga())
assertNotEquals(RelationType.Unknown, relatedManga.getRelationType(), "Unknown type: " + relatedManga.getRawRelationType());

assumeTrue(MangaPublishStatus.OnHiatus == mal.getManga(2).getStatus(), "Test will fail when status is not hiatus");

Check notice on line 152 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 8)

💤 dev/katsute/mal4j/MangaTests/TestManga testEnum :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L152 org.opentest4j.TestAbortedException: Assumption failed: Test will fail when status is not hiatus at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testEnum(TestManga.java:152) at java.lang.reflect.Method.invoke(Method.java:498) at java.util.ArrayList.forEach(ArrayList.java:1259) at java.util.ArrayList.forEach(ArrayList.java:1259)

Check notice on line 152 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 11)

💤 dev/katsute/mal4j/MangaTests/TestManga testEnum :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L152 org.opentest4j.TestAbortedException: Assumption failed: Test will fail when status is not hiatus at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testEnum(TestManga.java:152) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)

Check notice on line 152 in src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java

View workflow job for this annotation

GitHub Actions / MyAnimeList CI [Client] (Java 17)

💤 dev/katsute/mal4j/MangaTests/TestManga testEnum :

https://github.com/KatsuteDev/Mal4J/blob/7bc083aec68070992ac505d4a356292add49e3d6/./src/test/java/dev/katsute/mal4j/MangaTests/TestManga.java#L152 org.opentest4j.TestAbortedException: Assumption failed: Test will fail when status is not hiatus at org.junit.jupiter.api.Assumptions.throwAssumptionFailed(Assumptions.java:316) at org.junit.jupiter.api.Assumptions.assumeTrue(Assumptions.java:115) at dev.katsute.mal4j.MangaTests.TestManga.testEnum(TestManga.java:152) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
}

@Test
Expand Down
Loading