|
| 1 | +/* |
| 2 | + * Copyright (c) 2014, Francis Galiegue (fgaliegue@gmail.com) |
| 3 | + * |
| 4 | + * This software is dual-licensed under: |
| 5 | + * |
| 6 | + * - the Lesser General Public License (LGPL) version 3.0 or, at your option, any |
| 7 | + * later version; |
| 8 | + * - the Apache Software License (ASL) version 2.0. |
| 9 | + * |
| 10 | + * The text of this file and of both licenses is available at the root of this |
| 11 | + * project or, if you have the jar distribution, in directory META-INF/, under |
| 12 | + * the names LGPL-3.0.txt and ASL-2.0.txt respectively. |
| 13 | + * |
| 14 | + * Direct link to the sources: |
| 15 | + * |
| 16 | + * - LGPL 3.0: https://www.gnu.org/licenses/lgpl-3.0.txt |
| 17 | + * - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt |
| 18 | + */ |
| 19 | + |
| 20 | +package com.github.fge.jackson; |
| 21 | + |
| 22 | +import com.fasterxml.jackson.databind.JsonNode; |
| 23 | +import com.fasterxml.jackson.databind.node.JsonNodeFactory; |
| 24 | +import org.testng.annotations.BeforeClass; |
| 25 | +import org.testng.annotations.Test; |
| 26 | + |
| 27 | +import java.io.IOException; |
| 28 | +import java.util.Map; |
| 29 | + |
| 30 | +import static org.testng.Assert.*; |
| 31 | + |
| 32 | +public final class JacksonUtilsTest |
| 33 | +{ |
| 34 | + private JsonNode testData; |
| 35 | + |
| 36 | + @BeforeClass |
| 37 | + public void initData() |
| 38 | + throws IOException |
| 39 | + { |
| 40 | + testData = JsonLoader.fromResource("/testfile.json"); |
| 41 | + } |
| 42 | + |
| 43 | + @Test() |
| 44 | + public void asMapIsMutable() { |
| 45 | + Map<String, JsonNode> map = JacksonUtils.asMap(testData.required(0)); |
| 46 | + map.remove("reference"); |
| 47 | + } |
| 48 | +} |
0 commit comments