Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-3279

CRUD operations broken for HRDB external system in sample3

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • OpenIDM 3.2.0, OpenIDM 4.0.0
    • OpenIDM 4.0.0
    • _Samples
    • groovy connector 1.4.2.0-SNAPSHOT rev.6797, OpenJDK 1.7.0_79, OpenIDM 3.2.0-SNAPSHOT (revision: 5166)
    • 2
    • OpenIDM Sprint 51

    Description

      There are few major issues with new sample3 scripts

      Using asserts for exceptions instead of throw new Exception()

      Asserts did not properly raise an exception and output of request is as html error page
      DeleteScript.groovy#74 assert uid != null
      ResetDatabaseScript.groovy#190 assert results == expected
      SearchScript.groovy#80 assert cookieProps.size() == 2

      Cannot create an object on system/account

      • in provisioner file there is defined uid as string and is required
        curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"uid": "C_1430745837", "firstName": "1430745837", "lastName": "1430745837", "organization": "1430745837", "email": "foo@bar.com"}' --request POST "http://localhost:8080/openidm/system/hrdb/account/?_action=create"
        

        Exception

        Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'C_1430745837' with class 'java.lang.String' to class 'org.identityconnectors.framework.common.objects.Uid'
                at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:371)
                at org.codehaus.groovy.runtime.DefaultGroovyMethods.asType(DefaultGroovyMethods.java:12403)
                at org.codehaus.groovy.runtime.StringGroovyMethods.asType(StringGroovyMethods.java:211)
                at org.codehaus.groovy.runtime.dgm$896.doMethodInvoke(Unknown Source)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
                at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:889)
                at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:880)
                at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
        

        Workaround

        CreateScript.groovy#58
        def uid = id as Uid
        ->
        def uid = id as String
        

      Cannot update object on system/account

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --header "If-Match: *" --data '{"uid": "A_1430748308", "firstName": "1430748308", "lastName": "1430748308", "organization": "1430748308", "email": "update@email.com"}' --request PUT "http://localhost:8080/openidm/system/hrdb/account/8"
      Response Content: {"code":500,"reason":"Internal Server Error","message":"Cannot cast object 'A_1430748308' with class 'java.lang.String' to class 'org.identityconnectors.framework.common.objects.Uid'"}
      

      Workaround

      UpdateScript.groovy#60
      def uid = id as Uid
      ->
      def uid = id as String
      
      -----
      UpdateScript.groovy#97
      id = ?
      ->
      uid = ?
      -----
      UpdateScript.groovy#106,111,118,144,149,157,176
      uid.uidValue
      ->
      uid
      

      Cannot delete an object on system/account

      curl --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --header "If-Match: *" --request DELETE "http://localhost:8080/openidm/system/hrdb/account/13"
      Response Content: {"code":500,"reason":"Internal Server Error","message":"No such property: id for class: org.forgerock.openicf.connectors.hrdb.DeleteScript"}
      

      Workaround

      DeleteScript.groovy#52
      def uid = id as Uid
      ->
      def uid = uid as Uid
      

      Attachments

        Issue Links

          Activity

            People

              alin Alin Brici
              michal.orlik@profiq.cz Michal Orlik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: