Search in sources :

Example 1 with DataTypeConverter

use of com.fanap.podchat.util.DataTypeConverter in project pod-chat-android-sdk by FanapSoft.

the class ExampleUnitTest method converters.

@Test
public void converters() {
    String s = "[\"thread_admin\",\"add_new_user\",\"remove_user\"]";
    // String s = "[role1,role2,role3,role4]";
    DataTypeConverter dataTypeConverter = new DataTypeConverter();
    List<String> lst = new ArrayList<>();
    lst.add("thread_admin");
    lst.add("add_new_user");
    lst.add("remove_user");
    System.out.println(s);
    System.out.println(lst.toString());
    System.out.println("***");
    System.out.println(dataTypeConverter.dataToList(s));
    System.out.println(dataTypeConverter.convertListToString(lst));
    assertEquals(lst, dataTypeConverter.dataToList(s));
    assertEquals(s, dataTypeConverter.convertListToString(lst));
}
Also used : ArrayList(java.util.ArrayList) DataTypeConverter(com.fanap.podchat.util.DataTypeConverter) Test(org.junit.Test)

Aggregations

DataTypeConverter (com.fanap.podchat.util.DataTypeConverter)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1