forked from Archives/Athou_commafeed
remove commons-codec since we already have guava
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.commafeed.backend;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class DigestsTest {
|
||||
|
||||
@Test
|
||||
void sha1Hex() {
|
||||
Assertions.assertEquals("aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d", Digests.sha1Hex("hello"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void md5Hex() {
|
||||
Assertions.assertEquals("5d41402abc4b2a76b9719d911017c592", Digests.md5Hex("hello"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.commafeed.backend.feed;
|
||||
import java.time.Instant;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,6 +16,7 @@ import com.commafeed.backend.HttpGetter.HttpResult;
|
||||
import com.commafeed.backend.HttpGetter.NotModifiedException;
|
||||
import com.commafeed.backend.feed.parser.FeedParser;
|
||||
import com.commafeed.backend.urlprovider.FeedURLProvider;
|
||||
import com.google.gwt.thirdparty.guava.common.hash.Hashing;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class FeedFetcherTest {
|
||||
@@ -43,7 +43,7 @@ class FeedFetcherTest {
|
||||
String lastModified = "last-modified-1";
|
||||
String etag = "etag-1";
|
||||
byte[] content = "content".getBytes();
|
||||
String lastContentHash = DigestUtils.sha1Hex(content);
|
||||
String lastContentHash = Hashing.sha1().hashBytes(content).toString();
|
||||
|
||||
Mockito.when(getter.getBinary(url, lastModified, etag, 20000))
|
||||
.thenReturn(new HttpResult(content, "content-type", "last-modified-2", "etag-2", 20, null));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.commafeed.integration.rest;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.commafeed.backend.Digests;
|
||||
import com.commafeed.frontend.model.UserModel;
|
||||
import com.commafeed.frontend.model.request.ProfileModificationRequest;
|
||||
import com.commafeed.frontend.resource.fever.FeverResponse;
|
||||
@@ -64,7 +64,7 @@ class FeverIT extends BaseIT {
|
||||
|
||||
private FeverResponse fetch(String what, String apiKey) {
|
||||
Form form = new Form();
|
||||
form.param("api_key", DigestUtils.md5Hex("admin:" + apiKey));
|
||||
form.param("api_key", Digests.md5Hex("admin:" + apiKey));
|
||||
form.param(what, "1");
|
||||
return getClient().target(getApiBaseUrl() + "fever/user/{userId}")
|
||||
.resolveTemplate("userId", userId)
|
||||
|
||||
Reference in New Issue
Block a user