/**
 * Project RSA Algorithm.
 * Copyright Michał Szczygieł.
 * Created at Mar 14, 2014.
 */

package com.m4gik;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Test;

/**
 * This class contains JUnit tests for class {@link SHA1}.
 * 
 * @author Michał Szczygieł <michal.szczygiel@wp.pl>
 * 
 */
public class SHA1Test {

    private static final String EXAMPLE_TEXT = "The quick brown fox jumps over the lazy dog";
    private static final String HASHED_EXAMPLE_TEXT = "2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12";

    /**
     * This test method checks SHA1 algorithm for given string, which should be
     * correct with another algorithm based on SHA1.
     * 
     * @throws Exception
     */
    @Test
    public void checkCorrectnessOfSHA1() throws Exception {
        // given
        SHA1 sha1 = new SHA1();
        // when
        String result = sha1.hash(EXAMPLE_TEXT);
        // then
        assertThat(result, is(equalTo(HASHED_EXAMPLE_TEXT)));
    }
}

@@ -244,16 +244,74 @@
 tThat;%0A%0A
+import java.security.spec.InvalidParameterSpecException;%0A%0A
 import o
@@ -939,19 +939,18 @@
      // 
-giv
+wh
 en%0A     
@@ -957,28 +957,45 @@
    S
-HA1 sha1 = new SHA1(
+tring result = SHA1.hash(EXAMPLE_TEXT
 );%0A 
@@ -996,33 +996,33 @@
 XT);%0A        // 
-w
+t
 hen%0A        Stri
@@ -1021,34 +1021,45 @@
     
-String result = sha1.hash(
+assertThat(result, is(equalTo(HASHED_
 EXAM
@@ -1071,87 +1071,418 @@
 EXT)
+))
 ;%0A    
+%7D%0A%0A
     /
-/ then%0A        assertThat(result, is(equalTo(HASHED_EXAMPLE_TEXT)));
+**%0A     * This test method checks SHA1 algorithm for given string, and this method%0A     * shouldn't return exeption%0A     * %0A     * @throws Exception%0A     */%0A    @Test(%0A            expected = InvalidParameterSpecException.class)%0A    public void dataShouldBeMultipleOf64() throws Exception %7B%0A        // when%0A        SHA1.checkData(EXAMPLE_TEXT.getBytes());%0A        // then ... throw new Exception
 %0A   

Add test for checkData() method