diff options
author | vasraz <vasyl.razinkov@est.tech> | 2022-08-29 16:13:33 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2022-08-29 16:43:31 +0000 |
commit | 1b46a6e1d6fcf9788c9f18552f6f6b8fed60126c (patch) | |
tree | 4e63a047fb758bc15aa4594202a4ade33aeb9f47 /sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java | |
parent | cc595a0bfd90645b451ddee658fc496624072cea (diff) |
Migrate to Junit5
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: I00d5d08f0ad3ceeec94286f6500c4592585e7e34
Issue-ID: SDC-4148
Diffstat (limited to 'sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java')
-rw-r--r-- | sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java b/sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java index 3ed80c3..b18b8a8 100644 --- a/sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java +++ b/sdc-distribution-client/src/test/java/org/onap/sdc/utils/GeneralUtilsTest.java @@ -20,22 +20,22 @@ package org.onap.sdc.utils; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.base.Charsets; import com.google.common.hash.HashCode; import com.google.common.hash.Hashing; import java.util.Base64; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GeneralUtilsTest { +class GeneralUtilsTest { private static final String TEXT_TO_CODE = "This is example text."; @Test - public void shouldCalculateMD5ForBytes() { + void shouldCalculateMD5ForBytes() { String hashed = GeneralUtils.calculateMD5(TEXT_TO_CODE.getBytes()); byte[] decoded = Base64.getDecoder().decode(hashed); HashCode expected = Hashing.md5().hashString(TEXT_TO_CODE, Charsets.UTF_8); @@ -43,7 +43,7 @@ public class GeneralUtilsTest { } @Test - public void shouldCalculateMD5ForString() { + void shouldCalculateMD5ForString() { String hashed = GeneralUtils.calculateMD5(TEXT_TO_CODE); byte[] decoded = Base64.getDecoder().decode(hashed); HashCode expected = Hashing.md5().hashString(TEXT_TO_CODE, Charsets.UTF_8); @@ -51,16 +51,16 @@ public class GeneralUtilsTest { } @Test - public void shouldValidateBase64EncodedString() { + void shouldValidateBase64EncodedString() { HashCode expected = Hashing.md5().hashString(TEXT_TO_CODE, Charsets.UTF_8); String base64String = Base64.getEncoder().encodeToString(expected.asBytes()); assertTrue(GeneralUtils.isBase64Encoded(base64String)); } @Test - public void shouldInvalidateBase64EncodedString() { + void shouldInvalidateBase64EncodedString() { String base64String = Base64.getEncoder().encodeToString(TEXT_TO_CODE.getBytes()); assertFalse(GeneralUtils.isBase64Encoded(base64String)); } -}
\ No newline at end of file +} |