CLOUDSTACK-8658: test default platform charset

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #612
This commit is contained in:
Daan Hoogland 2015-07-21 22:46:43 +02:00 committed by wilderrodrigues
parent 822ea9c787
commit 2982fcf615
1 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,7 @@ package com.cloud.utils;
import static org.junit.Assert.assertEquals;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
@ -29,6 +30,16 @@ import junit.framework.Assert;
import org.junit.Test;
public class StringUtilsTest {
@Test
public void testGetPrefferedCharset() {
assertEquals(StringUtils.getPreferredCharset(),Charset.forName("UTF-8"));
}
@Test
public void testGetDefaultCharset() {
assertEquals(StringUtils.getPreferredCharset(),Charset.defaultCharset());
}
@Test
public void testCleanPasswordFromJsonObjectAtEnd() {
String input = "{\"foo\":\"bar\",\"password\":\"test\"}";