package com.filestack.model;

import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static com.filestack.util.MockConstants.*;

/**
 * Tests {@link Security Security} class to check encoding and signing.
 */
public class TestSecurity {
    private static final String CORRECT_ENCODED_POLICY = "eyJleHBpcnkiOjQ2NTM2NTE2MDB9";
    private static final String CORRECT_SIGNATURE = "d0dcacc68d00b7d2cd18c7f82aaf5bf172fdb423dc3cf0540d0da04912867e13";

    @Test
    public void TestEncoding() {
        Security security = Security.createNew(POLICY, APP_SECRET);

        assertTrue("Incorrect encoded policy ", CORRECT_ENCODED_POLICY.equals(security.getPolicy()));
    }

    @Test
    public void TestSigning() {
        Security security = Security.createNew(POLICY, APP_SECRET);

        assertTrue("Incorrect signature", CORRECT_SIGNATURE.equals(security.getSignature()));
    }
}

@@ -34,24 +34,114 @@
 ort 
-org.junit.Test;%0A
+static com.filestack.util.MockConstants.APP_SECRET;%0Aimport static com.filestack.util.MockConstants.POLICY;
 %0Aimp
@@ -184,56 +184,30 @@
 ue;%0A
+%0A
 import 
-static com.filestack.util.MockConstants.*
+org.junit.Test
 ;%0A%0A/
@@ -349,32 +349,24 @@
 ing CORRECT_
-ENCODED_
 POLICY = %22ey
@@ -445,16 +445,28 @@
 NATURE =
+%0A           
  %22d0dcac
@@ -553,17 +553,17 @@
 ic void 
-T
+t
 estEncod
@@ -673,16 +673,8 @@
 ect 
-encoded 
 poli
@@ -691,16 +691,8 @@
 ECT_
-ENCODED_
 POLI
@@ -758,17 +758,17 @@
 ic void 
-T
+t
 estSigni

Fix linter warnings for TestSecurity