Skip to content

Commit

Permalink
Add unit test for List.of().
Browse files Browse the repository at this point in the history
  • Loading branch information
joehni committed May 14, 2021
1 parent b141c44 commit 8215cb2
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 15. May 2021 by Joerg Schaible
*/
package com.thoughtworks.acceptance;

import java.util.List;


public class Collections09Test extends AbstractAcceptanceTest {

public void testListFromListOf() {
xstream.allowTypes("java.util.CollSer");

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

assertBothWays(list, ""//
+ "<java.util.ImmutableCollections_-List12 resolves-to=\"java.util.CollSer\" serialization=\"custom\">\n"
+ " <java.util.CollSer>\n"
+ " <default>\n"
+ " <tag>1</tag>\n"
+ " </default>\n"
+ " <int>2</int>\n"
+ " <string>hi</string>\n"
+ " <string>bye</string>\n"
+ " </java.util.CollSer>\n"
+ "</java.util.ImmutableCollections_-List12>");
}
}

0 comments on commit 8215cb2

Please sign in to comment.