package com.github.games647.fastlogin.bukkit;

import java.security.SecureRandom;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class EncryptionUtilTest {

    @Test
    public void testVerifyToken() throws Exception {
        SecureRandom random = new SecureRandom();
        byte[] token = EncryptionUtil.generateVerifyToken(random);

        assertNotNull(token);
        assertEquals(4, token.length);
    }

    // @Test
    // public void testDecryptSharedSecret() throws Exception {
    //
    // }
    //
    // @Test
    // public void testDecryptData() throws Exception {
    //
    // }

    // private static SecretKey createNewSharedKey() {
    //     try {
    //         KeyGenerator keygenerator = KeyGenerator.getInstance("AES");
    //         keygenerator.init(128);
    //         return keygenerator.generateKey();
    //     } catch (NoSuchAlgorithmException nosuchalgorithmexception) {
    //         throw new Error(nosuchalgorithmexception);
    //     }
    // }
}

@@ -122,34 +122,88 @@
 org.
-junit.Assert.assertEquals;
+hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.CoreMatchers.notNullValue;%0A
 %0Aimp
@@ -236,23 +236,20 @@
 t.assert
-NotNull
+That
 ;%0A%0Apubli
@@ -477,21 +477,34 @@
 sert
-NotNull(token
+That(token, notNullValue()
 );%0A 
@@ -520,18 +520,13 @@
 sert
-Equals(4, 
+That(
 toke
@@ -533,16 +533,23 @@
 n.length
+, is(4)
 );%0A    %7D

Migrate tests to assertThat