// Path: src/test/java/org/simplify4u/plugins/TestUtils.java
// public static KeyInfo aKeyInfo(String fingerprint) {
//     return KeyInfo.builder().fingerprint(new KeyFingerprint(fingerprint)).build();
// }


import java.io.IOException;
import java.io.InputStream;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.simplify4u.plugins.TestUtils.aKeyInfo;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
                .build();

        assertThat(keyInfo.getMaster()).isNotNull();
        assertThat(PublicKeyUtils.fingerprintForMaster(keyInfo))
                .isEqualTo("0x58E79B6ABC762159DC0B1591164BD2247B936711");
    }

    @Test
    public void userIdsWithSubKey() {

        PGPPublicKey key = SUB_KEY_ID.getKeyFromRing(publicKeyRing);

        assertThat(key.isMasterKey()).isFalse();
        assertThat(PublicKeyUtils.getUserIDs(key, publicKeyRing))
                .containsOnly("Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>");
    }

    @Test
    public void userIdsWithMasterKey() {

        PGPPublicKey key = publicKeyRing.getPublicKey(MASTER_KEY_ID);

        assertThat(key.isMasterKey()).isTrue();
        assertThat(PublicKeyUtils.getUserIDs(key, publicKeyRing))
                .containsOnly("Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>");
    }

    @Test
    public void keyIdDescriptionForMasterKey() {

// Path: src/test/java/org/simplify4u/plugins/TestUtils.java
// public static KeyInfo aKeyInfo(String fingerprint) {
//     return KeyInfo.builder().fingerprint(new KeyFingerprint(fingerprint)).build();
// }


// Path: src/test/java/org/simplify4u/plugins/pgp/PublicKeyUtilsTest.java
import java.io.IOException;
import java.io.InputStream;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.simplify4u.plugins.TestUtils.aKeyInfo;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

                .build();

        assertThat(keyInfo.getMaster()).isNotNull();
        assertThat(PublicKeyUtils.fingerprintForMaster(keyInfo))
                .isEqualTo("0x58E79B6ABC762159DC0B1591164BD2247B936711");
    }

    @Test
    public void userIdsWithSubKey() {

        PGPPublicKey key = SUB_KEY_ID.getKeyFromRing(publicKeyRing);

        assertThat(key.isMasterKey()).isFalse();
        assertThat(PublicKeyUtils.getUserIDs(key, publicKeyRing))
                .containsOnly("Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>");
    }

    @Test
    public void userIdsWithMasterKey() {

        PGPPublicKey key = publicKeyRing.getPublicKey(MASTER_KEY_ID);

        assertThat(key.isMasterKey()).isTrue();
        assertThat(PublicKeyUtils.getUserIDs(key, publicKeyRing))
                .containsOnly("Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>");
    }

    @Test
    public void keyIdDescriptionForMasterKey() {

        KeyInfo keyInfo = aKeyInfo("0x1234567890123456789012345678901234567890");