// Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/TransactionalService.java
// @Service
// public class TransactionalService {
// 
// 	@Autowired
// 	private ServiceRegistry serviceRegistry;
// 
// 	@AlfrescoTransaction
// 	public String transactionWriteWithoutPropagation() {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// 
// 	@AlfrescoTransaction(readOnly = true)
// 	public String transactioReadOnlyWithPropagationRequired() throws SystemException {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// 
// 	@AlfrescoTransaction(readOnly = true, propagation = Propagation.REQUIRES_NEW)
// 	public String transactioReadOnlyWithPropagationRequiresNew() throws SystemException {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// }


import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.transaction.SystemException;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.gradecak.alfresco.mvc.service.TransactionalService;
/**
 * Copyright gradecak.com

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.gradecak.alfresco.mvc.aop;





@ExtendWith(SpringExtension.class)
@ContextConfiguration(value = { "classpath:test-aop-context.xml" })
public class TransactionalTest {

	@Mock
	private RetryingTransactionHelper retryingTransactionHelper;

	@Autowired
	private ServiceRegistry serviceRegistry;

	@Autowired
// Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/TransactionalService.java
// @Service
// public class TransactionalService {
// 
// 	@Autowired
// 	private ServiceRegistry serviceRegistry;
// 
// 	@AlfrescoTransaction
// 	public String transactionWriteWithoutPropagation() {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// 
// 	@AlfrescoTransaction(readOnly = true)
// 	public String transactioReadOnlyWithPropagationRequired() throws SystemException {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// 
// 	@AlfrescoTransaction(readOnly = true, propagation = Propagation.REQUIRES_NEW)
// 	public String transactioReadOnlyWithPropagationRequiresNew() throws SystemException {
// 		return (String) serviceRegistry.getNodeService().getProperty(null, ContentModel.PROP_NAME);
// 	}
// }


// Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/aop/TransactionalTest.java
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.transaction.SystemException;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.gradecak.alfresco.mvc.service.TransactionalService;

/**
 * Copyright gradecak.com

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.gradecak.alfresco.mvc.aop;





@ExtendWith(SpringExtension.class)
@ContextConfiguration(value = { "classpath:test-aop-context.xml" })
public class TransactionalTest {

	@Mock
	private RetryingTransactionHelper retryingTransactionHelper;

	@Autowired
	private ServiceRegistry serviceRegistry;

	@Autowired
	private TransactionalService service;