From ed8d86f2bd53d8d21a4ea478c90b09408c9d1cc5 Mon Sep 17 00:00:00 2001 From: johnniang Date: Wed, 3 Apr 2019 09:26:41 +0800 Subject: [PATCH] Fix test errors and comment build.testResources in pom.xml --- pom.xml | 10 +++++----- .../cc/ryanc/halo/model/enums/AttachmentTypeTest.java | 8 ++++---- src/test/java/cc/ryanc/halo/utils/HaloUtilsTest.java | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 22ccd7625..f5db7dfc9 100755 --- a/pom.xml +++ b/pom.xml @@ -224,11 +224,11 @@ - - - ${basedir}/src/main/resources - - + + + + + diff --git a/src/test/java/cc/ryanc/halo/model/enums/AttachmentTypeTest.java b/src/test/java/cc/ryanc/halo/model/enums/AttachmentTypeTest.java index ff45099da..bd701b928 100644 --- a/src/test/java/cc/ryanc/halo/model/enums/AttachmentTypeTest.java +++ b/src/test/java/cc/ryanc/halo/model/enums/AttachmentTypeTest.java @@ -24,9 +24,9 @@ public class AttachmentTypeTest { @Test public void conversionTest() { - assertThat(conversionService.convert("SERVER", AttachmentType.class), equalTo(AttachmentType.LOCAL)); - assertThat(conversionService.convert("server", AttachmentType.class), equalTo(AttachmentType.LOCAL)); - assertThat(conversionService.convert("Server", AttachmentType.class), equalTo(AttachmentType.LOCAL)); - assertThat(conversionService.convert("SerVer", AttachmentType.class), equalTo(AttachmentType.LOCAL)); + assertThat(conversionService.convert("LOCAL", AttachmentType.class), equalTo(AttachmentType.LOCAL)); + assertThat(conversionService.convert("local", AttachmentType.class), equalTo(AttachmentType.LOCAL)); + assertThat(conversionService.convert("Local", AttachmentType.class), equalTo(AttachmentType.LOCAL)); + assertThat(conversionService.convert("LoCal", AttachmentType.class), equalTo(AttachmentType.LOCAL)); } } \ No newline at end of file diff --git a/src/test/java/cc/ryanc/halo/utils/HaloUtilsTest.java b/src/test/java/cc/ryanc/halo/utils/HaloUtilsTest.java index 90f545a3a..27e7e1143 100644 --- a/src/test/java/cc/ryanc/halo/utils/HaloUtilsTest.java +++ b/src/test/java/cc/ryanc/halo/utils/HaloUtilsTest.java @@ -70,7 +70,7 @@ public class HaloUtilsTest { assertThat(pluralizedFormat, equalTo("2 chances")); pluralizedFormat = HaloUtils.pluralize(0, label, pluralLabel); - assertThat(pluralizedFormat, equalTo("no chance")); + assertThat(pluralizedFormat, equalTo("no chances")); // Test random positive time IntStream.range(0, 10000).forEach(i -> { @@ -83,7 +83,7 @@ public class HaloUtilsTest { IntStream.range(0, 10000).forEach(i -> { long time = (-1) * RandomUtils.nextLong(); String result = HaloUtils.pluralize(time, label, pluralLabel); - assertThat(result, equalTo("no " + label)); + assertThat(result, equalTo("no " + pluralLabel)); }); }