Code formatting

pull/656/head
chen.ma 2 years ago
parent 9356a94eac
commit bb1db80d1f

@ -20,7 +20,6 @@ package cn.hippo4j.common.toolkit;
import cn.hippo4j.common.model.ThreadPoolParameterInfo; import cn.hippo4j.common.model.ThreadPoolParameterInfo;
import org.junit.Test; import org.junit.Test;
public class ContentUtilTest { public class ContentUtilTest {
@Test @Test

@ -1,94 +1,93 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package cn.hippo4j.common.toolkit; package cn.hippo4j.common.toolkit;
import org.junit.Test; import org.junit.Test;
import java.util.Objects; import java.util.Objects;
public class StringUtilTest { public class StringUtilTest {
@Test @Test
public void assertIsEmpty() { public void assertIsEmpty() {
String string = ""; String string = "";
Assert.isTrue(StringUtil.isEmpty(string)); Assert.isTrue(StringUtil.isEmpty(string));
} }
@Test @Test
public void assertIsNotEmpty() { public void assertIsNotEmpty() {
String string = "string"; String string = "string";
Assert.isTrue(StringUtil.isNotEmpty(string)); Assert.isTrue(StringUtil.isNotEmpty(string));
} }
@Test @Test
public void emptyToNull() { public void emptyToNull() {
String string = ""; String string = "";
Assert.isNull(StringUtil.emptyToNull(string)); Assert.isNull(StringUtil.emptyToNull(string));
} }
@Test @Test
public void nullToEmpty() { public void nullToEmpty() {
String string = "null"; String string = "null";
Assert.notEmpty(StringUtil.nullToEmpty(string)); Assert.notEmpty(StringUtil.nullToEmpty(string));
} }
@Test @Test
public void isNullOrEmpty() { public void isNullOrEmpty() {
String string = "null"; String string = "null";
Assert.isTrue(!StringUtil.isNullOrEmpty(string)); Assert.isTrue(!StringUtil.isNullOrEmpty(string));
} }
@Test @Test
public void isBlank() { public void isBlank() {
String string = ""; String string = "";
Assert.isTrue(StringUtil.isBlank(string)); Assert.isTrue(StringUtil.isBlank(string));
} }
@Test
@Test public void isNotBlank() {
public void isNotBlank() { String string = "null";
String string = "null"; Assert.isTrue(StringUtil.isNotBlank(string));
Assert.isTrue(StringUtil.isNotBlank(string)); }
}
@Test
@Test public void isAllNotEmpty() {
public void isAllNotEmpty() { String strings = "str";
String strings = "str"; Assert.isTrue(StringUtil.isAllNotEmpty(strings));
Assert.isTrue(StringUtil.isAllNotEmpty(strings)); }
}
@Test
@Test public void hasEmpty() {
public void hasEmpty() { String strings = "";
String strings = ""; Assert.isTrue(StringUtil.hasEmpty(strings));
Assert.isTrue(StringUtil.hasEmpty(strings)); }
}
@Test
@Test public void toUnderlineCase() {
public void toUnderlineCase() { String string = "str";
String string = "str"; String s = StringUtil.toUnderlineCase(string);
String s = StringUtil.toUnderlineCase(string); Assert.isTrue(Objects.equals(s, "str"));
Assert.isTrue(Objects.equals(s,"str")); }
}
@Test
@Test public void toSymbolCase() {
public void toSymbolCase() { String string = "str";
String string = "str"; String s = StringUtil.toSymbolCase(string, StringUtil.UNDERLINE);
String s = StringUtil.toSymbolCase(string,StringUtil.UNDERLINE); Assert.isTrue(Objects.equals(s, "str"));
Assert.isTrue(Objects.equals(s,"str")); }
} }
}

Loading…
Cancel
Save