Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3683

Concept Map Types in the standard test dataset have the wrong uuids

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      There are a few concept_map_type rows defined in standardTestDataset.xml, however these are not consistant with the ones we actually distribute with OpenMRS.

      For example in the test dataset the uuid for SAME-AS is f40555f0-49d5-11e0-8fed-18a905e044dc but in actual production databases it is 35543629-7d8c-11e1-909d-c80aa9edcf4e.

      We should change the concept_map_type rows in standardTestDataset.xml to be consistent (at least in their name and uuid) with what we actually distribute with OpenMRS.

      I ran into this error because I'm trying to import a Metadata Sharing package that contains a concept (and a mapping) in a unit test, and it fails because it's trying to create duplicate ConceptMapTypes with the name SAME-AS. Some of the stack trace:

      Caused by: org.openmrs.api.APIException: 'SAME-AS' failed to validate with reason: name: ConceptMapType.duplicate.name
      	at org.openmrs.validator.ValidateUtil.validate(ValidateUtil.java:85)
      	at org.openmrs.aop.RequiredDataAdvice.before(RequiredDataAdvice.java:137)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:49)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy32.saveConceptMapType(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy32.saveConceptMapType(Unknown Source)
      	... 94 more
      
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.invokeServiceSaveItem(OpenmrsClassScanner.java:291)
      	at org.openmrs.module.metadatasharing.reflection.OpenmrsClassScanner.serviceSaveItem(OpenmrsClassScanner.java:183)
      	at org.openmrs.module.metadatasharing.handler.impl.OpenmrsObjectHandler.saveItem(OpenmrsObjectHandler.java:112)
      	... 87 more
      

      The workaround for me is to not use the standard test dataset.

        Attachments

          Activity

            People

            Assignee:
            guilhermejccavalcanti Guilherme Cavalcanti
            Reporter:
            darius Darius Jazayeri
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours Original Estimate - 2 hours
                2h
                Remaining:
                Time Spent - 3 hours, 30 minutes Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - 3 hours, 30 minutes Remaining Estimate - 30 minutes
                3h 30m