Package com.jcabi.github

Examples of com.jcabi.github.PublicKeys


     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesKeys() throws Exception {
        final PublicKeys keys = new MkGithub().users().self().keys();
        final PublicKey key = keys.create("key", "ssh 1AA");
        MatcherAssert.assertThat(
            keys.iterate(),
            Matchers.hasItem(key)
        );
    }
View Full Code Here


     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canFetchSingleKey() throws Exception {
        final PublicKeys keys = new MkGithub().users().get("jeff").keys();
        MatcherAssert.assertThat(
            keys.get(1),
            Matchers.notNullValue()
        );
    }
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canCreatePublicKey() throws Exception {
        final PublicKeys keys = new MkGithub().users().get("john").keys();
        final PublicKey key = keys.create("Title1", "PublicKey1");
        MatcherAssert.assertThat(
            keys.get(key.number()),
            Matchers.equalTo(key)
        );
    }
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRemoveKey() throws Exception {
        final PublicKeys keys = new MkGithub().users().self().keys();
        final PublicKey key = keys.create("rsa", "rsa sh");
        MatcherAssert.assertThat(
            keys.iterate(),
            Matchers.hasItem(key)
        );
        keys.remove(key.number());
        MatcherAssert.assertThat(
            keys.iterate(),
            Matchers.not(Matchers.hasItem(key))
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.PublicKeys

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.