Skip to content

Commit

Permalink
first commit with the flexible privacy tests adapted
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Rojo <miguelangel.rojofernandez@mastercard.com>
  • Loading branch information
freemanzMrojo committed Aug 19, 2022
1 parent d296850 commit 2813ce7
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY_PROXY;
import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.EC;
import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.NACL;
import static org.hyperledger.enclave.testutil.EnclaveType.TESSERA;
import static org.junit.runners.Parameterized.Parameters;

import org.hyperledger.besu.tests.acceptance.dsl.condition.eth.EthConditions;
Expand Down Expand Up @@ -53,14 +56,20 @@
public class FlexiblePrivacyAcceptanceTest extends FlexiblePrivacyAcceptanceTestBase {

private final EnclaveType enclaveType;
private final EnclaveEncryptorType enclaveEncryptorType;

public FlexiblePrivacyAcceptanceTest(final EnclaveType enclaveType) {
public FlexiblePrivacyAcceptanceTest(final EnclaveType enclaveType, final EnclaveEncryptorType enclaveEncryptorType) {
this.enclaveType = enclaveType;
this.enclaveEncryptorType = enclaveEncryptorType;
}

@Parameters(name = "{0}")
public static Collection<EnclaveType> enclaveTypes() {
return EnclaveType.valuesForTests();
@Parameters(name = "{0} enclave type with {1} encryptor")
public static Collection<Object[]> enclaveParameters() {
return Arrays.asList(
new Object[][] {
{TESSERA, NACL},
{TESSERA, EC}
});
}

private PrivacyNode alice;
Expand All @@ -82,21 +91,21 @@ public void setUp() throws Exception {
alice =
privacyBesu.createFlexiblePrivacyGroupEnabledMinerNode(
"node1",
PrivacyAccountResolver.ALICE.resolve(EnclaveEncryptorType.NACL),
PrivacyAccountResolver.ALICE.resolve(enclaveEncryptorType),
false,
enclaveType,
Optional.of(containerNetwork));
bob =
privacyBesu.createFlexiblePrivacyGroupEnabledNode(
"node2",
PrivacyAccountResolver.BOB.resolve(EnclaveEncryptorType.NACL),
PrivacyAccountResolver.BOB.resolve(enclaveEncryptorType),
false,
enclaveType,
Optional.of(containerNetwork));
charlie =
privacyBesu.createFlexiblePrivacyGroupEnabledNode(
"node3",
PrivacyAccountResolver.CHARLIE.resolve(EnclaveEncryptorType.NACL),
PrivacyAccountResolver.CHARLIE.resolve(enclaveEncryptorType),
false,
enclaveType,
Optional.of(containerNetwork));
Expand Down

0 comments on commit 2813ce7

Please sign in to comment.