Skip to content

Commit

Permalink
Fix unit test for Java 9+10.
Browse files Browse the repository at this point in the history
  • Loading branch information
joehni committed May 15, 2021
1 parent 99c8e38 commit 4324f3a
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -12,6 +12,8 @@

import java.util.List;

import com.thoughtworks.xstream.core.JVM;


public class Collections09Test extends AbstractAcceptanceTest {

Expand All @@ -20,8 +22,8 @@ public void testListFromListOf() {

final List<String> list = List.of("hi", "bye");

assertBothWays(list, ""//
+ "<java.util.ImmutableCollections_-List12 resolves-to=\"java.util.CollSer\" serialization=\"custom\">\n"
assertBothWays(list, String.format(""//
+ "<java.util.ImmutableCollections_-List%1$d resolves-to=\"java.util.CollSer\" serialization=\"custom\">\n"
+ " <java.util.CollSer>\n"
+ " <default>\n"
+ " <tag>1</tag>\n"
Expand All @@ -30,6 +32,6 @@ public void testListFromListOf() {
+ " <string>hi</string>\n"
+ " <string>bye</string>\n"
+ " </java.util.CollSer>\n"
+ "</java.util.ImmutableCollections_-List12>");
+ "</java.util.ImmutableCollections_-List%1$d>", JVM.isVersion(11) ? 12 : 2));
}
}

0 comments on commit 4324f3a

Please sign in to comment.