Package com.box.boxjavalibv2.jsonentities

Source Code of com.box.boxjavalibv2.jsonentities.MapJSONStringEntityTest

package com.box.boxjavalibv2.jsonentities;

import org.junit.Assert;

import org.junit.Test;

import com.box.boxjavalibv2.exceptions.BoxJSONException;
import com.box.boxjavalibv2.jsonparsing.BoxJSONParser;
import com.box.boxjavalibv2.jsonparsing.BoxResourceHub;

public class MapJSONStringEntityTest {

    @Test
    public void testJson() throws BoxJSONException {
        String json = "{\"%s\":\"%s\"}";
        String name = "testname";
        String value = "testvalue";
        MapJSONStringEntity entity = new MapJSONStringEntity();

        entity.put(name, value);
        Assert.assertEquals(String.format(json, name, value), entity.toJSONString(new BoxJSONParser(new BoxResourceHub())));
    }
}
TOP

Related Classes of com.box.boxjavalibv2.jsonentities.MapJSONStringEntityTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.