aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java
diff options
context:
space:
mode:
authorMichael Keppler <michael.keppler@gmx.de>2014-04-22 17:30:51 +0200
committerMichael Keppler <michael.keppler@gmx.de>2014-04-22 21:44:00 +0200
commitcc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0 (patch)
treefca2712f72bb2759ef4e39c0235a8a5054f27013 /tests/src/cgeo/geocaching/utils/CryptUtilsTest.java
parent825b779844b280ba7c1effdd4185cc856eccdf5b (diff)
downloadcgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.zip
cgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.tar.gz
cgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.tar.bz2
#2414 convert junit statements to assertj
This conversion is not complete, but the remaining statements are hard to catch with regular expressions automatically.
Diffstat (limited to 'tests/src/cgeo/geocaching/utils/CryptUtilsTest.java')
-rw-r--r--tests/src/cgeo/geocaching/utils/CryptUtilsTest.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java b/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java
index 9a74167..7175f3d 100644
--- a/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java
+++ b/tests/src/cgeo/geocaching/utils/CryptUtilsTest.java
@@ -1,32 +1,34 @@
package cgeo.geocaching.utils;
+import static org.assertj.core.api.Assertions.assertThat;
+
import cgeo.geocaching.connector.gc.GCConstants;
import junit.framework.TestCase;
public class CryptUtilsTest extends TestCase {
public static void testROT13() {
- assertEquals("", CryptUtils.rot13(""));
- assertEquals("", CryptUtils.rot13((String) null));
- assertEquals("Pnpur uvag", CryptUtils.rot13("Cache hint"));
- assertEquals("Pnpur [plain] uvag", CryptUtils.rot13("Cache [plain] hint"));
- assertEquals("[all plain]", CryptUtils.rot13("[all plain]"));
- assertEquals("123", CryptUtils.rot13("123"));
+ assertThat(CryptUtils.rot13("")).isEqualTo("");
+ assertThat(CryptUtils.rot13((String) null)).isEqualTo("");
+ assertThat(CryptUtils.rot13("Cache hint")).isEqualTo("Pnpur uvag");
+ assertThat(CryptUtils.rot13("Cache [plain] hint")).isEqualTo("Pnpur [plain] uvag");
+ assertThat(CryptUtils.rot13("[all plain]")).isEqualTo("[all plain]");
+ assertThat(CryptUtils.rot13("123")).isEqualTo("123");
}
public static void testConvertToGcBase31() {
- assertEquals(1186660, GCConstants.gccodeToGCId("GC1PKK9"));
- assertEquals(4660, GCConstants.gccodeToGCId("GC1234"));
- assertEquals(61731, GCConstants.gccodeToGCId("GCF123"));
+ assertThat(GCConstants.gccodeToGCId("GC1PKK9")).isEqualTo(1186660);
+ assertThat(GCConstants.gccodeToGCId("GC1234")).isEqualTo(4660);
+ assertThat(GCConstants.gccodeToGCId("GCF123")).isEqualTo(61731);
}
public static void testIssue1902() {
- assertEquals("ƖƖlƖƖƖƖ", CryptUtils.rot13("ƖƖyƖƖƖƖ"));
+ assertThat(CryptUtils.rot13("ƖƖyƖƖƖƖ")).isEqualTo("ƖƖlƖƖƖƖ");
}
public static void testMd5() {
- assertEquals("d41d8cd98f00b204e9800998ecf8427e", CryptUtils.md5(""));
+ assertThat(CryptUtils.md5("")).isEqualTo("d41d8cd98f00b204e9800998ecf8427e");
// expected value taken from debugger. should assure every developer uses UTF-8
- assertEquals("a7f4e3ec08f09be2ef7ecb4eea5f8981", CryptUtils.md5("äöü"));
+ assertThat(CryptUtils.md5("äöü")).isEqualTo("a7f4e3ec08f09be2ef7ecb4eea5f8981");
}
}