1 package net.pterodactylus.sone.core;
3 import static freenet.keys.InsertableClientSSK.createRandom;
4 import static net.pterodactylus.sone.core.SoneUri.create;
5 import static org.hamcrest.MatcherAssert.assertThat;
6 import static org.hamcrest.Matchers.is;
7 import static org.hamcrest.Matchers.nullValue;
9 import freenet.crypt.DummyRandomSource;
10 import freenet.keys.FreenetURI;
12 import org.junit.Test;
15 * Unit test for {@link SoneUri}.
17 public class SoneUriTest {
20 public void callConstructorForIncreasedTestCoverage() {
25 public void returnedUriHasCorrectDocNameAndMetaStrings() {
26 FreenetURI uri = createRandom(new DummyRandomSource(), "test-0").getURI().uskForSSK();
27 assertThat(create(uri.toString()).getDocName(), is("Sone"));
28 assertThat(create(uri.toString()).getAllMetaStrings(), is(new String[0]));
32 public void malformedUriReturnsNull() {
33 assertThat(create("not a key"), nullValue());