diff --git a/pom.xml b/pom.xml
index 6805617..f85bcd2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,11 +91,11 @@
1.9.0
test
-
-
- org.mozilla
- rhino
- 1.7.10
+
+ net.sourceforge.htmlunit
+ htmlunit
+ 2.32
+ test
diff --git a/src/test/java/ut/com/atlassian/plugins/confluence/MarkdownUnitTest.java b/src/test/java/ut/com/atlassian/plugins/confluence/MarkdownUnitTest.java
index 191a422..b6547fe 100644
--- a/src/test/java/ut/com/atlassian/plugins/confluence/MarkdownUnitTest.java
+++ b/src/test/java/ut/com/atlassian/plugins/confluence/MarkdownUnitTest.java
@@ -4,11 +4,18 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
+import static org.hamcrest.CoreMatchers.*;
+
+import net.sourceforge.htmlunit.*;
+import com.gargoylesoftware.htmlunit.*;
+import com.gargoylesoftware.htmlunit.html.*;
import org.mockito.*;
import org.mockito.runners.MockitoJUnitRunner;
+import java.io.*;
+import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.regex.Pattern;
@@ -17,7 +24,6 @@ import com.atlassian.confluence.macro.MacroExecutionException;
import com.atlassian.webresource.api.assembler.PageBuilderService;
import com.atlassian.webresource.api.assembler.RequiredResources;
import com.atlassian.webresource.api.assembler.WebResourceAssembler;
-
import com.atlassian.plugins.confluence.markdown.MarkdownMacro;
@RunWith (MockitoJUnitRunner.class)
@@ -45,14 +51,52 @@ public class MarkdownUnitTest {
@Test
public void testSyntaxHighlighting() throws MacroExecutionException {
/*Test that the correct JavaScript is returned for highlight.js to work*/
- // Run the macro using input of a line of code in a code block,
- // then assert that a block is returned.
- // Intended only as a temporary test until I can program a better one
- @SuppressWarnings({ "rawtypes", "unchecked" })
- String output = markdownMacro.execute(new HashMap(), "`public class JavaClass {}`", conversionContext);
- System.out.println(output);
- assertTrue(Pattern.matches("[\\S\\s]*public class JavaClass \\{\\}<\\/code>[\\S\\s]*", output));
- assertTrue(Pattern.matches("[\\S\\s]*\r\n" +
+ " \r\n" +
+ " \r\n" +
+ "\r\n" +
+ "\r\n" +
+ " \r\n" +
+ "" +
+ output +
+ "
" +
+ "\r\n" +
+ "