Skip to content

Commit

Permalink
支持配置JSON,并自动转成相应类型(3)-补全单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhdaniel committed Aug 6, 2017
1 parent 0f01388 commit 3c6e405
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baidu.disconf.client.support.utils;
package com.baidu.disconf.client.test.support.utils;

import static org.junit.Assert.assertTrue;

Expand All @@ -7,6 +7,8 @@

import org.junit.Test;

import com.baidu.disconf.client.support.utils.ClassUtils;

public class ClassUtilsTest {

@SuppressWarnings("unchecked")
Expand All @@ -29,4 +31,12 @@ public void testGetValeByType() throws Exception {
assertTrue(ClassUtils.getValeByType(List.class, "234.4,123") == null);
}

@Test
public void testGetFieldNameByGetMethodName() {
assertTrue(ClassUtils.getFieldNameByGetMethodName("getOrderNo").equals("orderNo"));
assertTrue(ClassUtils.getFieldNameByGetMethodName("isSended").equals("sended"));
assertTrue(ClassUtils.getFieldNameByGetMethodName("isA").equals("a"));
assertTrue(ClassUtils.getFieldNameByGetMethodName("someMethod") == null);
}

}

0 comments on commit 3c6e405

Please sign in to comment.