diff --git a/src/main/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructure.java b/src/main/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructure.java index 1ab06ab..944cc42 100644 --- a/src/main/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructure.java +++ b/src/main/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructure.java @@ -9,7 +9,17 @@ import java.io.IOException; import java.io.Serializable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Queue; +import java.util.Stack; @JsonSerialize(using = AccessStructure.Serialize.class) @JsonDeserialize(using = AccessStructure.Deserialize.class) diff --git a/src/test/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructureTest.java b/src/test/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructureTest.java index bedfc0f..3a135fb 100644 --- a/src/test/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructureTest.java +++ b/src/test/java/sg/edu/ntu/sce/sands/crypto/dcpabe/ac/AccessStructureTest.java @@ -1,6 +1,5 @@ package sg.edu.ntu.sce.sands.crypto.dcpabe.ac; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import sg.edu.ntu.sce.sands.crypto.dcpabe.ac.AccessStructure.MatrixElement; @@ -9,17 +8,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class AccessStructureTest { - private AccessStructure arho; - private String policy; - - @BeforeEach - public void setUp() { - policy = "and or D and C B A"; - arho = AccessStructure.buildFromPolicy(policy); - } + private final String policy = "and or D and C B A"; @Test public void testPolicyToStringConversion() throws Exception { + AccessStructure arho = AccessStructure.buildFromPolicy(policy); + String recoveredPolicy = arho.toString(); assertEquals(policy, recoveredPolicy); }