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 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
19 public class SoneUriTest {
22 public void callConstructorForIncreasedTestCoverage() {
27 public void returnedUriHasCorrectDocNameAndMetaStrings() {
28 FreenetURI uri = createRandom(new DummyRandomSource(), "test-0").getURI().uskForSSK();
29 assertThat(create(uri.toString()).getDocName(), is("Sone"));
30 assertThat(create(uri.toString()).getAllMetaStrings(), is(new String[0]));
34 public void malformedUriReturnsNull() {
35 assertThat(create("not a key"), nullValue());