Search in sources :

Example 41 with CustomScript

use of org.gluu.model.custom.script.model.CustomScript in project oxAuth by GluuFederation.

the class IdGenServiceTest method loadCustomScript.

@Test
public void loadCustomScript() {
    final InputStream inputStream = IdGenServiceTest.class.getResourceAsStream("/id/gen/SampleIdGenerator.py");
    try {
        final String idScript = IOUtils.toString(inputStream);
        CustomScript idCustomScript = buildIdCustomScriptEntry(idScript);
        this.idCustomScriptDn = idCustomScript.getDn();
        ldapEntryManager.persist(idCustomScript);
    } catch (IOException e) {
        throw new RuntimeException(e);
    } finally {
        IOUtils.closeQuietly(inputStream);
    }
}
Also used : CustomScript(org.gluu.model.custom.script.model.CustomScript) InputStream(java.io.InputStream) IOException(java.io.IOException) Test(org.testng.annotations.Test) BaseComponentTest(org.gluu.oxauth.BaseComponentTest)

Example 42 with CustomScript

use of org.gluu.model.custom.script.model.CustomScript in project oxAuth by GluuFederation.

the class IdGenServiceTest method removeCustomScript.

@Test(dependsOnMethods = "testCustomIdGenerationByPythonScript")
public void removeCustomScript() {
    CustomScript customScript = new CustomScript();
    customScript.setDn(this.idCustomScriptDn);
    ldapEntryManager.remove(customScript);
}
Also used : CustomScript(org.gluu.model.custom.script.model.CustomScript) Test(org.testng.annotations.Test) BaseComponentTest(org.gluu.oxauth.BaseComponentTest)

Aggregations

CustomScript (org.gluu.model.custom.script.model.CustomScript)42 ArrayList (java.util.ArrayList)20 AuthenticationCustomScript (org.gluu.model.custom.script.model.auth.AuthenticationCustomScript)11 CustomScriptType (org.gluu.model.custom.script.CustomScriptType)8 IOException (java.io.IOException)7 SimpleCustomProperty (org.gluu.model.SimpleCustomProperty)6 HttpEntity (org.apache.http.HttpEntity)5 HttpResponse (org.apache.http.HttpResponse)5 ParseException (org.apache.http.ParseException)5 SimpleExtendedCustomProperty (org.gluu.model.SimpleExtendedCustomProperty)5 Test (org.junit.Test)5 List (java.util.List)4 CustomScriptConfiguration (org.gluu.model.custom.script.conf.CustomScriptConfiguration)4 HttpGet (org.apache.http.client.methods.HttpGet)3 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)3 SelectableEntity (org.gluu.model.SelectableEntity)3 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)3 Filter (org.gluu.search.filter.Filter)3 Operation (io.swagger.v3.oas.annotations.Operation)2 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)2