import org.junit.Test;
import static org.junit.Assert.*;

import com.drexler.velson.tools.UtilTool;
import java.io.UnsupportedEncodingException;

public class UtilToolTest
{
   @Test
   public void base64EncodeWithValidStringReturnsEncodedString()
   {
      UtilTool util = new UtilTool();
      String expectedEncodedString = "aGVsbG8=";
      String result = "";
      try
      {
        result = util.base64Encode("hello");
      }
      catch(UnsupportedEncodingException ex)
      {
        fail("Exception shouldn't be thrown!");
      }
      assertEquals(expectedEncodedString, result);
   }

   @Test
   public void base64DecodeWithValidDataReturnsOriginalData()
   {
      UtilTool util = new UtilTool();
      String expectedDecodedString = "hello";
      String result = "";
      try
      {
        result = util.base64Decode("aGVsbG8=");
      }
      catch(UnsupportedEncodingException ex)
      {
        fail("Exception shouldn't be thrown!");
      }
      assertEquals(expectedDecodedString, result);
   }
}

@@ -1061,12 +1061,398 @@
 ;%0D%0A   %7D%0D
+%0A%0D%0A   @Test%0D%0A   public void escapeJavascriptUsesJavascriptEscapingRules()%0D%0A   %7B%0D%0A      UtilTool util = new UtilTool();%0D%0A      String original = %22Oh no you don't%22;%0D%0A      String expected = %22Oh no you don%5C%5C't%22;      // Note: additional %5C is added here for escaping within this. Upgrade to latest Java to use backticks%0D%0A      assertEquals(expected, util.escapeJavaScript(original));%0D%0A   %7D%0D
 %0A%7D%0D%0A

add cover unit test