Reinstate (apply) Spring's @DirtiesContext annotation.

Additionally, declare before & after class setup/tear down proceduce to reset the ClusterAwareConfiguration.ClusterAwareCondition.
This commit is contained in:
John Blum
2021-03-24 16:03:00 -07:00
parent 579bd368de
commit f82cf51931
5 changed files with 29 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ import java.io.IOException;
import javax.annotation.Resource;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -40,6 +41,7 @@ import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedReg
import org.springframework.data.gemfire.mapping.annotation.Region;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.data.repository.CrudRepository;
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
@@ -79,6 +81,11 @@ public class SpringBootApacheGeodeIntegrationTest extends ForkingClientServerInt
startGemFireServer(TestGeodeServerConfiguration.class);
}
@BeforeClass @AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}
@Resource(name = "Users")
private org.apache.geode.cache.Region<String, User> users;