Add @transactional to delete data-dictionary 26/131926/1
authorJozsef Csongvai <jozsef.csongvai@bell.ca>
Mon, 31 Oct 2022 20:25:57 +0000 (16:25 -0400)
committerJozsef Csongvai <jozsef.csongvai@bell.ca>
Mon, 31 Oct 2022 20:28:38 +0000 (16:28 -0400)
The delete endpoint was failing due to missing annotation.

Issue-ID: CCSDK-3798
Change-Id: Ifa857a4842b9528d1e645e1fdeb6781121a930f7
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryRepository.kt
ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryReactRepositoryTest.kt

index 703542f..e44e4e8 100644 (file)
@@ -20,6 +20,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ResourceDictio
 import org.springframework.data.jpa.repository.JpaRepository
 import org.springframework.data.jpa.repository.Query
 import org.springframework.stereotype.Repository
+import javax.transaction.Transactional
 
 /**
  * ResourceMappingRepository.java Purpose: Provide Configuration Generator ResourceMappingRepository
@@ -59,6 +60,7 @@ interface ResourceDictionaryRepository : JpaRepository<ResourceDictionary, Strin
      *
      * @param name name
      */
+    @Transactional
     fun deleteByName(name: String)
 
     /**
index 988fa4d..45d1152 100644 (file)
@@ -30,7 +30,6 @@ import org.springframework.test.annotation.Commit
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.SpringRunner
-import org.springframework.transaction.annotation.Transactional
 
 @RunWith(SpringRunner::class)
 @ContextConfiguration(
@@ -80,7 +79,6 @@ class ResourceDictionaryReactRepositoryTest {
     }
 
     @Test
-    @Transactional
     @Commit
     fun test05Delete() {
         resourceDictionaryRepository.deleteByName(sourceName)