// Path: chapter09/src/main/java/com/blogspot/toomuchcoding/book/chapter9/exception/CustomException.java
// public class CustomException extends RuntimeException {
// 	
// }


import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.*;
import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.when;
import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.BDDMockito.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
import com.blogspot.toomuchcoding.book.chapter9.exception.CustomException;
import com.blogspot.toomuchcoding.person.Person;
package com.blogspot.toomuchcoding.book.chapter9.InjectingWithSpring;




/**
 * Added prefixes to test method names to ensure method execution order
 */
@ContextConfiguration(classes = {TaxConfiguration.class, ReusedMockTaxConfiguration.class})
public class TaxTransfererCodeConfigurationReusedMockTestNgTest  extends AbstractTestNGSpringContextTests {

    @Autowired TaxTransferer taxTransferer;

    @Autowired TaxService taxService;

    @Test(priority = 1)
    public void _1_should_fail_to_transfer_tax_for_person() {
        // given
        Person person = new Person();
// Path: chapter09/src/main/java/com/blogspot/toomuchcoding/book/chapter9/exception/CustomException.java
// public class CustomException extends RuntimeException {
// 	
// }


// Path: chapter09/src/test/java/com/blogspot/toomuchcoding/book/chapter9/InjectingWithSpring/TaxTransfererCodeConfigurationReusedMockTestNgTest.java
import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.*;
import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.when;
import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.BDDMockito.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
import com.blogspot.toomuchcoding.book.chapter9.exception.CustomException;
import com.blogspot.toomuchcoding.person.Person;

package com.blogspot.toomuchcoding.book.chapter9.InjectingWithSpring;




/**
 * Added prefixes to test method names to ensure method execution order
 */
@ContextConfiguration(classes = {TaxConfiguration.class, ReusedMockTaxConfiguration.class})
public class TaxTransfererCodeConfigurationReusedMockTestNgTest  extends AbstractTestNGSpringContextTests {

    @Autowired TaxTransferer taxTransferer;

    @Autowired TaxService taxService;

    @Test(priority = 1)
    public void _1_should_fail_to_transfer_tax_for_person() {
        // given
        Person person = new Person();
		willThrow(CustomException.class).given(taxService).transferTaxFor(any(Person.class));