mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change link
This commit is contained in:
@@ -2199,7 +2199,7 @@ public class CollUtil {
|
||||
iter = (Iterator) value;
|
||||
} else if (value instanceof Iterable) {
|
||||
if(value instanceof Map && BeanUtil.isBean(TypeUtil.getClass(elementType))){
|
||||
//https://github.com/dromara/hutool/issues/3139
|
||||
//https://github.com/chinabugotech/hutool/issues/3139
|
||||
// 如果值为Map,而目标为一个Bean,则Map应整体转换为Bean,而非拆分成Entry转换
|
||||
iter = new ArrayIter<>(new Object[]{value});
|
||||
}else{
|
||||
|
@@ -36,7 +36,7 @@ public class NumberWithFormat extends Number implements TypeConverter {
|
||||
// 自定义日期格式
|
||||
if (null != this.format && targetType instanceof Class) {
|
||||
final Class<?> clazz = (Class<?>) targetType;
|
||||
// https://gitee.com/dromara/hutool/issues/I6IS5B
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I6IS5B
|
||||
if (Date.class.isAssignableFrom(clazz)) {
|
||||
return new DateConverter((Class<? extends Date>) clazz, format).convert(this.number, null);
|
||||
} else if (TemporalAccessor.class.isAssignableFrom(clazz)) {
|
||||
|
@@ -206,7 +206,7 @@ public class TemporalAccessorConverter extends AbstractConverter<TemporalAccesso
|
||||
|
||||
final Instant instant;
|
||||
if (GlobalCustomFormat.FORMAT_SECONDS.equals(this.format)) {
|
||||
// https://gitee.com/dromara/hutool/issues/I6IS5B
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I6IS5B
|
||||
// Unix时间戳
|
||||
instant = Instant.ofEpochSecond(time);
|
||||
} else {
|
||||
|
@@ -1055,7 +1055,7 @@ public class FileUtil extends PathUtil {
|
||||
int exceptionsCount = 0;
|
||||
while (true) {
|
||||
try {
|
||||
// https://github.com/dromara/hutool/issues/3103
|
||||
// https://github.com/chinabugotech/hutool/issues/3103
|
||||
//File file = File.createTempFile(prefix, suffix, mkdir(dir)).getCanonicalFile();
|
||||
final File file = PathUtil.createTempFile(prefix, suffix, null == dir ? null : dir.toPath()).toFile().getCanonicalFile();
|
||||
if (isReCreat) {
|
||||
|
@@ -17,7 +17,7 @@ import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 复制jdk16中的Optional,以及自己进行了一点调整和新增,比jdk8中的Optional多了几个实用的函数<br>
|
||||
* 详细见:<a href="https://gitee.com/dromara/hutool/pulls/426">https://gitee.com/dromara/hutool/pulls/426</a>
|
||||
* 详细见:<a href="https://gitee.com/chinabugotech/hutool/pulls/426">https://gitee.com/chinabugotech/hutool/pulls/426</a>
|
||||
*
|
||||
* @param <T> 包裹里元素的类型
|
||||
* @author VampireAchao
|
||||
|
@@ -146,9 +146,9 @@ public interface RegexPool {
|
||||
* 中国车牌号码(兼容新能源车牌)
|
||||
*/
|
||||
String PLATE_NUMBER =
|
||||
//https://gitee.com/dromara/hutool/issues/I1B77H?from=project-issue
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I1B77H?from=project-issue
|
||||
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
|
||||
//https://gitee.com/dromara/hutool/issues/I1BJHE?from=project-issue
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I1BJHE?from=project-issue
|
||||
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]\\d{3}\\d{1,3}[领])|" +
|
||||
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$";
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import java.util.Stack;
|
||||
|
||||
/**
|
||||
* 数学表达式计算工具类<br>
|
||||
* 见:https://github.com/dromara/hutool/issues/1090#issuecomment-693750140
|
||||
* 见:https://github.com/chinabugotech/hutool/issues/1090#issuecomment-693750140
|
||||
*
|
||||
* @author trainliang, looly
|
||||
* @since 5.4.3
|
||||
|
@@ -11,7 +11,7 @@ import java.util.Currency;
|
||||
/**
|
||||
* 单币种货币类,处理货币算术、币种和取整。
|
||||
* <p>
|
||||
* 感谢提供此方法的用户:https://github.com/dromara/hutool/issues/605
|
||||
* 感谢提供此方法的用户:https://github.com/chinabugotech/hutool/issues/605
|
||||
*
|
||||
* <p>
|
||||
* 货币类中封装了货币金额和币种。目前金额在内部是long类型表示,
|
||||
|
@@ -518,7 +518,7 @@ public class NetUtil {
|
||||
* <p>
|
||||
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
|
||||
* <p>
|
||||
* 见:https://github.com/dromara/hutool/issues/428
|
||||
* 见:https://github.com/chinabugotech/hutool/issues/428
|
||||
*
|
||||
* @return 本机网卡IP地址,获取失败返回{@code null}
|
||||
* @since 3.0.1
|
||||
|
@@ -363,7 +363,7 @@ public final class CsvWriter implements Closeable, Flushable, Serializable {
|
||||
@Override
|
||||
public void close() {
|
||||
if(this.config.endingLineBreak){
|
||||
//https://gitee.com/dromara/hutool/issues/I75K5G
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I75K5G
|
||||
writeLine();
|
||||
}
|
||||
IoUtil.close(this.writer);
|
||||
|
@@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
|
||||
public class BeanCopyMappingTest {
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I4C48U <br>
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I4C48U <br>
|
||||
* 传递复制不要用注解别名,应该用动态映射
|
||||
*/
|
||||
@Test
|
||||
|
@@ -253,7 +253,7 @@ public class BeanUtilTest {
|
||||
final SubPersonWithAlias subPersonWithAlias = BeanUtil.toBean(map, SubPersonWithAlias.class);
|
||||
assertEquals("sub名字", subPersonWithAlias.getSubName());
|
||||
|
||||
//https://gitee.com/dromara/hutool/issues/I6H0XF
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I6H0XF
|
||||
assertFalse(subPersonWithAlias.isBooleana());
|
||||
assertNull(subPersonWithAlias.getBooleanb());
|
||||
}
|
||||
@@ -520,7 +520,7 @@ public class BeanUtilTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://github.com/dromara/hutool/issues/1173">#1173</a>
|
||||
* <a href="https://github.com/chinabugotech/hutool/issues/1173">#1173</a>
|
||||
*/
|
||||
@Test
|
||||
public void beanToBeanOverlayFieldTest() {
|
||||
@@ -597,7 +597,7 @@ public class BeanUtilTest {
|
||||
|
||||
@Test
|
||||
public void copyBeanPropertiesFunctionFilterTest() {
|
||||
//https://gitee.com/dromara/hutool/pulls/590
|
||||
//https://gitee.com/chinabugotech/hutool/pulls/590
|
||||
final Person o = new Person();
|
||||
o.setName("asd");
|
||||
o.setAge(123);
|
||||
@@ -858,7 +858,7 @@ public class BeanUtilTest {
|
||||
|
||||
@Test
|
||||
public void valueProviderToBeanTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I5B4R7
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I5B4R7
|
||||
final CopyOptions copyOptions = CopyOptions.create();
|
||||
final Map<String, String> filedMap = new HashMap<>();
|
||||
filedMap.put("name", "sourceId");
|
||||
@@ -931,7 +931,7 @@ public class BeanUtilTest {
|
||||
|
||||
@Test
|
||||
public void hasGetterTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I6M7Z7
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I6M7Z7
|
||||
final boolean b = BeanUtil.hasGetter(Object.class);
|
||||
assertFalse(b);
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/1687
|
||||
* https://github.com/chinabugotech/hutool/issues/1687
|
||||
*/
|
||||
public class Issue1687Test {
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2009
|
||||
* https://github.com/chinabugotech/hutool/issues/2009
|
||||
*/
|
||||
public class Issue2009Test {
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2082<br>
|
||||
* https://github.com/chinabugotech/hutool/issues/2082<br>
|
||||
* 当setXXX有重载方法的时候,BeanDesc中会匹配到重载方法,增加类型检查来规避之
|
||||
*/
|
||||
public class Issue2082Test {
|
||||
|
@@ -12,7 +12,7 @@ import java.util.Map;
|
||||
public class Issue2202Test {
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2202
|
||||
* https://github.com/chinabugotech/hutool/issues/2202
|
||||
*/
|
||||
@Test
|
||||
public void mapToBeanWithFieldNameEditorTest(){
|
||||
|
@@ -8,7 +8,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2697
|
||||
* https://github.com/chinabugotech/hutool/issues/2697
|
||||
*/
|
||||
public class Issue2697Test {
|
||||
|
||||
|
@@ -854,7 +854,7 @@ public class CollUtilTest {
|
||||
|
||||
@Test
|
||||
public void setValueByMapTest() {
|
||||
// https://gitee.com/dromara/hutool/pulls/482
|
||||
// https://gitee.com/chinabugotech/hutool/pulls/482
|
||||
final List<Person> people = Arrays.asList(
|
||||
new Person("aa", 12, "man", 1),
|
||||
new Person("bb", 13, "woman", 2),
|
||||
|
@@ -12,7 +12,7 @@ public class IssueI5DRU0Test {
|
||||
@Test
|
||||
@Disabled
|
||||
public void appendTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I5DRU0
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I5DRU0
|
||||
// 向zip中添加文件的时候,如果添加的文件的父目录已经存在,会报错。实际中目录存在忽略即可。
|
||||
ZipUtil.append(Paths.get("d:/test/zipTest.zip"), Paths.get("d:/test/zipTest"), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/IAGYDG
|
||||
* https://gitee.com/chinabugotech/hutool/issues/IAGYDG
|
||||
*/
|
||||
public class IssueIAGYDGTest {
|
||||
@Test
|
||||
|
@@ -351,7 +351,7 @@ public class ConvertTest {
|
||||
|
||||
@Test
|
||||
public void toBigDecimalTest() {
|
||||
// https://github.com/dromara/hutool/issues/1818
|
||||
// https://github.com/chinabugotech/hutool/issues/1818
|
||||
final String str = "33020000210909112800000124";
|
||||
final BigDecimal bigDecimal = Convert.toBigDecimal(str);
|
||||
assertEquals(str, bigDecimal.toPlainString());
|
||||
@@ -359,7 +359,7 @@ public class ConvertTest {
|
||||
|
||||
@Test
|
||||
public void toFloatTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4M0E4
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4M0E4
|
||||
final String hex2 = "CD0CCB43";
|
||||
final byte[] value = HexUtil.decodeHex(hex2);
|
||||
final float f = Convert.toFloat(value);
|
||||
|
@@ -25,7 +25,7 @@ public class CalendarUtilTest {
|
||||
final Calendar calendar = CalendarUtil.parse("2021-09-27 00:00:112323", false,
|
||||
DatePattern.NORM_DATETIME_FORMAT);
|
||||
|
||||
// https://github.com/dromara/hutool/issues/1849
|
||||
// https://github.com/chinabugotech/hutool/issues/1849
|
||||
// 在使用严格模式时,秒不正确,抛出异常
|
||||
DateUtil.date(calendar);
|
||||
});
|
||||
|
@@ -117,7 +117,7 @@ public class ChineseDateTest {
|
||||
|
||||
@Test
|
||||
public void getChineseMonthTest2(){
|
||||
//https://github.com/dromara/hutool/issues/2112
|
||||
//https://github.com/chinabugotech/hutool/issues/2112
|
||||
ChineseDate springFestival = new ChineseDate(DateUtil.parseDate("2022-02-01"));
|
||||
final String chineseMonth = springFestival.getChineseMonth();
|
||||
assertEquals("一月", chineseMonth);
|
||||
@@ -125,7 +125,7 @@ public class ChineseDateTest {
|
||||
|
||||
@Test
|
||||
public void day19700101Test(){
|
||||
// https://gitee.com/dromara/hutool/issues/I4UTPK
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4UTPK
|
||||
Date date = DateUtil.parse("1970-01-01");
|
||||
//noinspection ConstantConditions
|
||||
ChineseDate chineseDate = new ChineseDate(date);
|
||||
@@ -153,7 +153,7 @@ public class ChineseDateTest {
|
||||
|
||||
@Test
|
||||
public void getGregorianDateTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I4ZSGJ
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4ZSGJ
|
||||
ChineseDate chineseDate = new ChineseDate(1998, 5, 1);
|
||||
assertEquals("1998-06-24 00:00:00", chineseDate.getGregorianDate().toString());
|
||||
|
||||
|
@@ -1002,7 +1002,7 @@ public class DateUtilTest {
|
||||
|
||||
@Test
|
||||
public void parseNotFitTest() {
|
||||
//https://github.com/dromara/hutool/issues/1332
|
||||
//https://github.com/chinabugotech/hutool/issues/1332
|
||||
assertThrows(DateException.class, () -> {
|
||||
// 在日期格式不匹配的时候,测试是否正常报错
|
||||
DateUtil.parse("2020-12-23", DatePattern.PURE_DATE_PATTERN);
|
||||
|
@@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
public class Issue2981Test {
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2981<br>
|
||||
* https://github.com/chinabugotech/hutool/issues/2981<br>
|
||||
* 按照ISO8601规范,以Z结尾表示UTC时间,否则为当地时间
|
||||
*/
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
|
@@ -8,7 +8,7 @@ import java.util.Calendar;
|
||||
public class Issue3011Test {
|
||||
@Test
|
||||
public void isSameMonthTest() {
|
||||
// https://github.com/dromara/hutool/issues/3011
|
||||
// https://github.com/chinabugotech/hutool/issues/3011
|
||||
// 判断是否同一个月,还需考虑公元前和公元后的的情况
|
||||
// 此处公元前2020年和公元2021年返回年都是2021
|
||||
final Calendar calendar1 = Calendar.getInstance();
|
||||
|
@@ -52,7 +52,7 @@ public class FileCopierTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void copyFileByRelativePath(){
|
||||
// https://github.com/dromara/hutool/pull/2188
|
||||
// https://github.com/chinabugotech/hutool/pull/2188
|
||||
// 当复制的目标文件位置是相对路径的时候可以通过
|
||||
FileCopier copier = FileCopier.create(new File("pom.xml"),new File("aaa.txt"));
|
||||
copier.copy();
|
||||
|
@@ -76,7 +76,7 @@ public class FileTypeUtilTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void webpTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I5BGTF
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I5BGTF
|
||||
final File file = FileUtil.file("d:/test/a.webp");
|
||||
final BufferedInputStream inputStream = FileUtil.getInputStream(file);
|
||||
final String type = FileTypeUtil.getType(inputStream);
|
||||
|
@@ -8,7 +8,7 @@ import java.io.File;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/IAB65V
|
||||
* https://gitee.com/chinabugotech/hutool/issues/IAB65V
|
||||
*/
|
||||
public class IssueIAB65VTest {
|
||||
@Test
|
||||
|
@@ -10,7 +10,7 @@ import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/pulls/532
|
||||
* https://gitee.com/chinabugotech/hutool/pulls/532
|
||||
*/
|
||||
public class MetroHashTest {
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 见:https://gitee.com/dromara/hutool/pulls/447/files
|
||||
* 见:https://gitee.com/chinabugotech/hutool/pulls/447/files
|
||||
*
|
||||
* TODO 同时继承泛型和实现泛型接口需要解析,此处为F
|
||||
*/
|
||||
|
@@ -28,7 +28,7 @@ public class CaseInsensitiveMapTest {
|
||||
|
||||
@Test
|
||||
public void mergeTest(){
|
||||
//https://github.com/dromara/hutool/issues/2086
|
||||
//https://github.com/chinabugotech/hutool/issues/2086
|
||||
Pair<String, String> b = new Pair<>("a", "value");
|
||||
Pair<String, String> a = new Pair<>("A", "value");
|
||||
final CaseInsensitiveMap<Object, Object> map = new CaseInsensitiveMap<>();
|
||||
|
@@ -32,7 +32,7 @@ public class CalculatorTest {
|
||||
|
||||
@Test
|
||||
public void conversationTest5(){
|
||||
// https://github.com/dromara/hutool/issues/1984
|
||||
// https://github.com/chinabugotech/hutool/issues/1984
|
||||
final double conversion = Calculator.conversion("((1/1) / (1/1) -1) * 100");
|
||||
assertEquals(0, conversion, 0);
|
||||
}
|
||||
@@ -45,14 +45,14 @@ public class CalculatorTest {
|
||||
|
||||
@Test
|
||||
public void conversationTest7() {
|
||||
//https://gitee.com/dromara/hutool/issues/I4KONB
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I4KONB
|
||||
final double conversion = Calculator.conversion("((-2395+0) * 0.3+140.24+35+90)/30");
|
||||
assertEquals(-15.11, conversion, 0.01);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issue2964Test() {
|
||||
// https://github.com/dromara/hutool/issues/2964
|
||||
// https://github.com/chinabugotech/hutool/issues/2964
|
||||
final double calcValue = Calculator.conversion("(11+2)12");
|
||||
assertEquals(156D, calcValue, 0.001);
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void buildWithoutSlashTest() {
|
||||
// https://github.com/dromara/hutool/issues/2459
|
||||
// https://github.com/chinabugotech/hutool/issues/2459
|
||||
String buildUrl = UrlBuilder.of().setScheme("http").setHost("192.168.1.1").setPort(8080).setWithEndTag(false).build();
|
||||
assertEquals("http://192.168.1.1:8080", buildUrl);
|
||||
|
||||
@@ -279,7 +279,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void encodePathTest2() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4RA42
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4RA42
|
||||
// Path中`:`在第一个segment需要转义,之后的不需要
|
||||
final String urlStr = "https://hutool.cn/aa/bb/Pre-K,Kindergarten,First,Second,Third,Fourth,Fifth/Page:3";
|
||||
final UrlBuilder urlBuilder = UrlBuilder.ofHttp(urlStr, CharsetUtil.CHARSET_UTF_8);
|
||||
@@ -298,7 +298,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void fragmentEncodeTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I49KAL
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I49KAL
|
||||
// 见:https://stackoverflow.com/questions/26088849/url-fragment-allowed-characters
|
||||
final String url = "https://hutool.cn/docs/#/?id=简介";
|
||||
UrlBuilder urlBuilder = UrlBuilder.ofHttp(url);
|
||||
@@ -310,7 +310,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void slashEncodeTest() {
|
||||
// https://github.com/dromara/hutool/issues/1904
|
||||
// https://github.com/chinabugotech/hutool/issues/1904
|
||||
// 在query中,"/"是不可转义字符
|
||||
// 见:https://www.rfc-editor.org/rfc/rfc3986.html#section-3.4
|
||||
final String url = "https://invoice.maycur.com/2b27a802-8423-4d41-86f5-63a6b259f61e.xlsx?download/2b27a802-8423-4d41-86f5-63a6b259f61e.xlsx&e=1630491088";
|
||||
@@ -333,7 +333,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void addPathEncodeTest2() {
|
||||
// https://github.com/dromara/hutool/issues/1912
|
||||
// https://github.com/chinabugotech/hutool/issues/1912
|
||||
final String url = UrlBuilder.of()
|
||||
.setScheme("https")
|
||||
.setHost("domain.cn")
|
||||
@@ -359,7 +359,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void fragmentTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I49KAL#note_8060874
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I49KAL#note_8060874
|
||||
final String url = "https://www.hutool.cn/#/a/b?timestamp=1640391380204";
|
||||
final UrlBuilder builder = UrlBuilder.ofHttp(url);
|
||||
|
||||
@@ -368,7 +368,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void fragmentAppendParamTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I49KAL#note_8060874
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I49KAL#note_8060874
|
||||
final String url = "https://www.hutool.cn/#/a/b";
|
||||
final UrlBuilder builder = UrlBuilder.ofHttp(url);
|
||||
builder.setFragment(builder.getFragment() + "?timestamp=1640391380204");
|
||||
@@ -437,7 +437,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void issue2243Test() {
|
||||
// https://github.com/dromara/hutool/issues/2243
|
||||
// https://github.com/chinabugotech/hutool/issues/2243
|
||||
// 如果用户已经做了%编码,不应该重复编码
|
||||
final String url = "https://hutool.cn/v1.0?privateNum=%2B8616512884988";
|
||||
final String s = UrlBuilder.of(url, null).setCharset(CharsetUtil.CHARSET_UTF_8).toString();
|
||||
@@ -471,7 +471,7 @@ public class UrlBuilderTest {
|
||||
|
||||
@Test
|
||||
public void addPathTest() {
|
||||
//https://gitee.com/dromara/hutool/issues/I5O4ML
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I5O4ML
|
||||
UrlBuilder.of().addPath("");
|
||||
UrlBuilder.of().addPath("/");
|
||||
UrlBuilder.of().addPath("//");
|
||||
|
@@ -22,7 +22,7 @@ public class UrlDecoderTest {
|
||||
|
||||
@Test
|
||||
public void issue3063Test() throws UnsupportedEncodingException {
|
||||
// https://github.com/dromara/hutool/issues/3063
|
||||
// https://github.com/chinabugotech/hutool/issues/3063
|
||||
|
||||
final String s = "测试";
|
||||
final String expectedDecode = "%FE%FF%6D%4B%8B%D5";
|
||||
|
@@ -52,7 +52,7 @@ public class UrlQueryTest {
|
||||
|
||||
@Test
|
||||
public void parseTest4(){
|
||||
// https://github.com/dromara/hutool/issues/1989
|
||||
// https://github.com/chinabugotech/hutool/issues/1989
|
||||
String queryStr = "imageMogr2/thumbnail/x800/format/jpg";
|
||||
final UrlQuery query = UrlQuery.of(queryStr, CharsetUtil.CHARSET_UTF_8);
|
||||
assertEquals(queryStr, query.toString());
|
||||
|
@@ -17,7 +17,7 @@ public class CharSequenceUtilTest {
|
||||
|
||||
@Test
|
||||
public void replaceTest2() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4M16G
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4M16G
|
||||
String replace = "#{A}";
|
||||
String result = CharSequenceUtil.replace(replace, "#{AAAAAAA}", "1");
|
||||
assertEquals(replace, result);
|
||||
@@ -49,7 +49,7 @@ public class CharSequenceUtilTest {
|
||||
result = CharSequenceUtil.addSuffixIfNot(str, " is Good");
|
||||
assertEquals(str + " is Good", result);
|
||||
|
||||
// https://gitee.com/dromara/hutool/issues/I4NS0F
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4NS0F
|
||||
result = CharSequenceUtil.addSuffixIfNot("", "/");
|
||||
assertEquals("/", result);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class CharSequenceUtilTest {
|
||||
|
||||
@Test
|
||||
public void subPreGbkTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4JO2E
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4JO2E
|
||||
String s = "华硕K42Intel酷睿i31代2G以下独立显卡不含机械硬盘固态硬盘120GB-192GB4GB-6GB";
|
||||
|
||||
String v = CharSequenceUtil.subPreGbk(s, 40, false);
|
||||
@@ -101,7 +101,7 @@ public class CharSequenceUtilTest {
|
||||
|
||||
@Test
|
||||
public void startWithTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4MV7Q
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4MV7Q
|
||||
assertFalse(CharSequenceUtil.startWith("123", "123", false, true));
|
||||
assertFalse(CharSequenceUtil.startWith(null, null, false, true));
|
||||
assertFalse(CharSequenceUtil.startWith("abc", "abc", true, true));
|
||||
|
@@ -35,9 +35,9 @@ public class NamingCaseTest {
|
||||
.set("H#case", "H#case")
|
||||
.set("PNLabel", "PN_label")
|
||||
.set("wPRunOZTime", "w_P_run_OZ_time")
|
||||
// https://github.com/dromara/hutool/issues/2070
|
||||
// https://github.com/chinabugotech/hutool/issues/2070
|
||||
.set("customerNickV2", "customer_nick_v2")
|
||||
// https://gitee.com/dromara/hutool/issues/I4X9TT
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I4X9TT
|
||||
.set("DEPT_NAME","DEPT_NAME")
|
||||
.forEach((key, value) -> assertEquals(value, NamingCase.toUnderlineCase(key)));
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/IA8WE0
|
||||
* https://gitee.com/chinabugotech/hutool/issues/IA8WE0
|
||||
*/
|
||||
public class IssueIA8WE0Test {
|
||||
@Test
|
||||
|
@@ -74,7 +74,7 @@ public class StrSplitterTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/2099
|
||||
* https://github.com/chinabugotech/hutool/issues/2099
|
||||
*/
|
||||
@Test
|
||||
public void splitByRegexTest(){
|
||||
|
@@ -11,7 +11,7 @@ public class ExecutorBuilderTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void CallerRunsPolicyTest(){
|
||||
// https://gitee.com/dromara/hutool/pulls/660
|
||||
// https://gitee.com/chinabugotech/hutool/pulls/660
|
||||
final ThreadPoolExecutor executor = ExecutorBuilder.create().setCorePoolSize(1).setMaxPoolSize(1).setHandler(RejectPolicy.BLOCK.getValue()).build();
|
||||
executor.execute(()-> Console.log("### 1"));
|
||||
executor.execute(()-> Console.log("### 2"));
|
||||
|
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class SyncFinisherTest {
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I716SX
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I716SX
|
||||
* 设置ExceptionHandler捕获异常
|
||||
*/
|
||||
@Test
|
||||
@@ -44,7 +44,7 @@ public class SyncFinisherTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I716SX
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I716SX
|
||||
* 默认情况下吞掉异常
|
||||
*/
|
||||
@Test
|
||||
|
@@ -39,7 +39,7 @@ public class EscapeUtilTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I49JU8
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I49JU8
|
||||
*/
|
||||
@Test
|
||||
public void escapeAllTest2(){
|
||||
|
@@ -45,7 +45,7 @@ public class HexUtilTest {
|
||||
String a = "0x3544534F444";
|
||||
assertTrue(HexUtil.isHexNumber(a));
|
||||
|
||||
// https://gitee.com/dromara/hutool/issues/I62H7K
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I62H7K
|
||||
a = "0x0000000000000001158e460913d00000";
|
||||
assertTrue(HexUtil.isHexNumber(a));
|
||||
|
||||
@@ -53,7 +53,7 @@ public class HexUtilTest {
|
||||
a = "0x0000001000T00001158e460913d00000";
|
||||
assertFalse(HexUtil.isHexNumber(a));
|
||||
|
||||
// 错误的,https://github.com/dromara/hutool/issues/2857
|
||||
// 错误的,https://github.com/chinabugotech/hutool/issues/2857
|
||||
a = "-1";
|
||||
assertFalse(HexUtil.isHexNumber(a));
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* https://github.com/dromara/hutool/issues/3136
|
||||
* https://github.com/chinabugotech/hutool/issues/3136
|
||||
*/
|
||||
public class Issue3136Test {
|
||||
|
||||
|
@@ -416,7 +416,7 @@ public class StrUtilTest {
|
||||
containsAny = StrUtil.containsAny("aaabbbccc", "d", "c");
|
||||
assertTrue(containsAny);
|
||||
|
||||
// https://gitee.com/dromara/hutool/issues/I7WSYD
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I7WSYD
|
||||
containsAny = StrUtil.containsAny("你好啊", "嗯", null);
|
||||
assertFalse(containsAny);
|
||||
}
|
||||
@@ -651,7 +651,7 @@ public class StrUtilTest {
|
||||
|
||||
@Test
|
||||
public void issueI6KKFUTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I6KKFU
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I6KKFU
|
||||
final String template = "I''m {0} years old.";
|
||||
final String result = StrUtil.indexedFormat(template, 10);
|
||||
assertEquals("I'm 10 years old.", result);
|
||||
|
@@ -149,7 +149,7 @@ public class ZipUtilTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void zipStreamTest(){
|
||||
//https://github.com/dromara/hutool/issues/944
|
||||
//https://github.com/chinabugotech/hutool/issues/944
|
||||
final String dir = "d:/test";
|
||||
final String zip = "d:/test.zip";
|
||||
//noinspection IOStreamConstructor
|
||||
@@ -164,7 +164,7 @@ public class ZipUtilTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void zipStreamTest2(){
|
||||
// https://github.com/dromara/hutool/issues/944
|
||||
// https://github.com/chinabugotech/hutool/issues/944
|
||||
final String file1 = "d:/test/a.txt";
|
||||
final String file2 = "d:/test/a.txt";
|
||||
final String file3 = "d:/test/asn1.key";
|
||||
|
Reference in New Issue
Block a user