X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FFreenetLinkPartTest.java;h=f29fddeecc0fdb0aafdf45209c52df86febfd315;hp=57284bf34cd082f71bd5aaeaa2300598b342da0b;hb=7b55e0be6a3283e43a9bbab98f82aebdd948eb33;hpb=1d7e3aae6a6a885a7492eb445988a5437c63cb0d diff --git a/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java b/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java index 57284bf..f29fdde 100644 --- a/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java +++ b/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java @@ -39,4 +39,29 @@ public class FreenetLinkPartTest { assertThat(new FreenetLinkPart("link", "text", true).getTitle(), is("text")); } + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForLink() { + new FreenetLinkPart(null, "text", "title", true); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForText() { + new FreenetLinkPart("link", null, "title", true); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForLinkInSecondaryConstructor() { + new FreenetLinkPart(null, "text", true); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForTextInSecondaryConstructor() { + new FreenetLinkPart("link", null, true); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForTitle() { + new FreenetLinkPart("link", "text", null, true); + } + }