Search in sources :

Example 1 with SAMLTrustRelationshipShort

use of org.gluu.oxtrust.api.saml.SAMLTrustRelationshipShort in project oxTrust by GluuFederation.

the class SamlTestScenary method run.

/**
 * Run tests.
 *
 * @throws APITestException
 * @throws OxTrustAPIException
 */
public void run() throws APITestException, OxTrustAPIException {
    TrustRelationshipClient samlClient = client.getTrustRelationshipClient();
    GluuSAMLTrustRelationship trGenerated = generateRandomeSingleTrustRelationship();
    // test create()
    String inum = samlClient.create(trGenerated);
    // test read()
    GluuSAMLTrustRelationship trReaded = samlClient.read(inum);
    // TODO: compare etities
    trReaded.setDescription("description changed");
    // test update()
    samlClient.update(trReaded, inum);
    // test list()
    List<SAMLTrustRelationshipShort> trustRelationships = samlClient.list();
    if (!checkListForTrustRelationship(trustRelationships, inum))
        throw new APITestException("TrustRelationship really not saved");
    // test delete()
    samlClient.delete(inum);
    trustRelationships = samlClient.list();
    if (checkListForTrustRelationship(trustRelationships, inum))
        throw new APITestException("TrustRelationship really not deleted");
// TODO: all API calls
}
Also used : GluuSAMLTrustRelationship(org.gluu.oxtrust.model.GluuSAMLTrustRelationship) APITestException(org.gluu.oxtrust.api.test.APITestException) TrustRelationshipClient(org.gluu.oxtrust.api.client.saml.TrustRelationshipClient) SAMLTrustRelationshipShort(org.gluu.oxtrust.api.saml.SAMLTrustRelationshipShort)

Aggregations

TrustRelationshipClient (org.gluu.oxtrust.api.client.saml.TrustRelationshipClient)1 SAMLTrustRelationshipShort (org.gluu.oxtrust.api.saml.SAMLTrustRelationshipShort)1 APITestException (org.gluu.oxtrust.api.test.APITestException)1 GluuSAMLTrustRelationship (org.gluu.oxtrust.model.GluuSAMLTrustRelationship)1