Skip to content
Snippets Groups Projects
Unverified Commit 6400385a authored by drgnchan's avatar drgnchan Committed by GitHub
Browse files

test:add test case for StringFormatUtils (#3579)

parent 08d05669
No related branches found
No related tags found
No related merge requests found
package io.seata.common.util;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class StringFormatUtilsTest {
@Test
void camelToUnderline() {
assertThat(StringFormatUtils.camelToUnderline(null)).isEqualTo("");
assertThat(StringFormatUtils.camelToUnderline(" ")).isEqualTo("");
assertThat(StringFormatUtils.camelToUnderline("abcDefGh")).isEqualTo("abc_def_gh");
}
@Test
void underlineToCamel() {
assertThat(StringFormatUtils.underlineToCamel(null)).isEqualTo("");
assertThat(StringFormatUtils.underlineToCamel(" ")).isEqualTo("");
assertThat(StringFormatUtils.underlineToCamel("abc_def_gh")).isEqualTo("abcDefGh");
}
@Test
void minusToCamel() {
assertThat(StringFormatUtils.minusToCamel(null)).isEqualTo("");
assertThat(StringFormatUtils.minusToCamel(" ")).isEqualTo("");
assertThat(StringFormatUtils.minusToCamel("abc-def-gh")).isEqualTo("abcDefGh");
}
@Test
void dotToCamel() {
assertThat(StringFormatUtils.dotToCamel(null)).isEqualTo("");
assertThat(StringFormatUtils.dotToCamel(" ")).isEqualTo("");
assertThat(StringFormatUtils.dotToCamel("abc.def.gh")).isEqualTo("abcDefGh");
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment