Skip to content

Commit 31ed79d

Browse files
committed
fix/add test case about DefaultObjectFactoryTest
1 parent 5ecbc05 commit 31ed79d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/test/java/org/apache/ibatis/reflection/factory/DefaultObjectFactoryTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void createClassThrowsProperErrorMsg() {
6262
}
6363

6464
@Test
65-
void creatHashMap() {
65+
void createHashMap() {
6666
DefaultObjectFactory defaultObjectFactory=new DefaultObjectFactory();
6767
Map map= defaultObjectFactory.create(Map.class,null,null);
6868
Assertions.assertTrue(map instanceof HashMap, "Should be HashMap");
@@ -94,4 +94,14 @@ void createHashSet() {
9494
Set set = defaultObjectFactory.create(Set.class);
9595
Assertions.assertTrue(set instanceof HashSet, " set should be HashSet");
9696
}
97+
98+
@Test
99+
void testIsCollection() {
100+
DefaultObjectFactory defaultObjectFactory = new DefaultObjectFactory();
101+
boolean trueTarget = defaultObjectFactory.isCollection(ArrayList.class);
102+
Assertions.assertTrue(trueTarget,"ArrayList should be Collection");
103+
104+
boolean falseTarget = defaultObjectFactory.isCollection(HashMap.class);
105+
Assertions.assertFalse(falseTarget,"HashMap should't be Collection");
106+
}
97107
}

0 commit comments

Comments
 (0)