package me.chyxion.tigon.test;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializeConfig;
import me.chyxion.tigon.json.ViewModelableSerializer;
import me.chyxion.tigon.model.ViewModel;
import org.junit.Test;

import java.util.Arrays;

/**
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Mar 19, 2017 12:17:14
 */
public class ViewModelSerializerTest {

	@Test
    @SuppressWarnings("unchecked")
    public void test() {
        SerializeConfig.getGlobalInstance()
            .put(ViewModel.class, new ViewModelableSerializer());
        System.err.println(JSON.toJSONString(
            Arrays.asList(new ViewModel<Integer>(1).setAttr("Foo", "BAR"))));
    }
}
