Package com.openshift.client

Examples of com.openshift.client.IAuthorization.destroy()


        Assert.notNull(id);
        IAuthorization auth = getAuthorization(id);
        if (auth == null) {
            return false;
        }
        auth.destroy();
        api.removeAuthorization();
        //sets authorization list to null so next get/create will reload
        api.refresh();
        return true;
    }
View Full Code Here


    // verifications
    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);
    assertEquals(token, authorization.getToken());

    authorization.destroy();
  }

  @Test
  public void shouldCreateAuthorization() throws Exception {
    // pre-conditions
View Full Code Here

    // verifications
    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);
    assertEquals(authorization.getNote(), "my note");

    authorization.destroy();
  }

  @Test
  public void shouldCreateAuthorizationWithExpiration() throws Exception {
    // pre-conditions
View Full Code Here

    // verifications
    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);
    assertEquals(authorization.getNote(), "my note");

    authorization.destroy();
  }

  @Test
  public void shouldDestroyAuthorization() throws Exception {
    // pre-conditions
View Full Code Here

    // pre-conditions
    IAuthorization authorization = user.createAuthorization("my note", IAuthorization.SCOPE_READ, 600);
    assertNotNull(authorization.getToken());

    // operations
    authorization.destroy();

    // verification
    assertNull(authorization.getId());
    assertNull(authorization.getScopes());
    assertNull(authorization.getToken());
View Full Code Here

    // pre-conditions
    IAuthorization authorization = user.createAuthorization("my note", IAuthorization.SCOPE_READ, 600);
    assertNotNull(authorization.getToken());

    // operations
    authorization.destroy();

    // verification
    // new authorization created upon #getAuthorization() since old one is destroyed
    IAuthorization newAuthorization = user.getAuthorization();
    assertFalse(authorization.equals(newAuthorization));
View Full Code Here

    authorization = connection.getUser().getAuthorization();
   
    // verifications
    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);

    authorization.destroy();
  }

  @Test
  public void shouldCreateAuthorization() throws Exception {
    // pre-conditions
View Full Code Here

    // verifications
    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);
    assertEquals(authorization.getNote(), "my note");

    authorization.destroy();
  }

  @Test
  public void shouldCreateAuthorizationWithExpiration() throws Exception {
    // pre-conditions
View Full Code Here

    assertEquals(authorization.getScopes(), IAuthorization.SCOPE_SESSION);
    assertEquals(authorization.getNote(), "my note");
        //check for time remaining on the token now
        assertTrue((authorization.getExpiresIn() <= 600));
   
    authorization.destroy();
  }

  @Test
  public void shouldReplaceExistingAuthorization() throws Exception {
    // pre-conditions
View Full Code Here

    assertEquals(newAuthorization.getNote(), "new note");
    assertTrue(newAuthorization.getExpiresIn() != 600);
   
    // cleanup
    authorization.destroy();
    newAuthorization.destroy();
  }

    @Test
    public void shouldCheckReadPermissions() throws Exception {
        // pre-conditions
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.