mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.hutool.core.io.file;
|
||||
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -69,7 +70,13 @@ public class PathUtilTest {
|
||||
@Test
|
||||
public void getMimeOfRarTest(){
|
||||
final String contentType = FileUtil.getMimeType("a001.rar");
|
||||
Assertions.assertEquals("application/x-rar-compressed", contentType);
|
||||
Assertions.assertTrue(
|
||||
ArrayUtil.contains(
|
||||
new String[]{
|
||||
"application/x-rar-compressed",
|
||||
// JDK9+修改为此
|
||||
"application/vnd.rar"},
|
||||
contentType));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -180,6 +180,17 @@ public class LambdaUtilTest {
|
||||
Assertions.assertTrue(bean.isFlag());
|
||||
}
|
||||
|
||||
@Test
|
||||
void buildSetterTest() {
|
||||
final Bean bean = new Bean();
|
||||
bean.setId(2L);
|
||||
bean.setFlag(false);
|
||||
|
||||
final BiConsumer<Bean, Object> setter = LambdaUtil.buildSetter(Bean.class, "flag");
|
||||
setter.accept(bean, true);
|
||||
Assertions.assertTrue(bean.isFlag());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void lambdaTest() {
|
||||
|
Reference in New Issue
Block a user