Skip to content
Permalink
Browse files
Further clean up of new test suites.
  • Loading branch information
myrle-krantz committed Jul 31, 2017
1 parent e2f812c commit aef0c5183102fe9f2977ebd88465ef04b3c9f556
Showing 4 changed files with 10 additions and 20 deletions.
@@ -15,10 +15,9 @@
*/
package io.mifos.anubis;

import io.mifos.anubis.example.noinitialize.ExampleConfiguration;
import io.mifos.anubis.example.noinitialize.Example;
import io.mifos.core.test.fixture.TenantDataStoreContextTestRule;
import org.junit.Rule;
import io.mifos.anubis.example.noinitialize.ExampleConfiguration;
import io.mifos.anubis.suites.SuiteTestEnvironment;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,7 +30,6 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import io.mifos.anubis.suites.SuiteTestEnvironment;

/**
* @author Myrle Krantz
@@ -64,7 +62,4 @@ public Logger logger() {
@Autowired
@Qualifier(value = LOGGER_QUALIFIER)
Logger logger;

@Rule
public final TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer);
}
@@ -65,7 +65,4 @@ public Logger logger() {
@Autowired
@Qualifier(value = LOGGER_QUALIFIER)
Logger logger;

@Rule
public final TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer);
}
@@ -17,9 +17,8 @@

import io.mifos.anubis.example.simple.Example;
import io.mifos.anubis.example.simple.ExampleConfiguration;
import io.mifos.anubis.suites.SuiteTestEnvironment;
import io.mifos.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
import io.mifos.core.test.fixture.TenantDataStoreContextTestRule;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -33,7 +32,6 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import io.mifos.anubis.suites.SuiteTestEnvironment;

/**
* @author Myrle Krantz
@@ -68,9 +66,6 @@ public Logger logger() {
@Qualifier(value = LOGGER_QUALIFIER)
Logger logger;

@ClassRule
public final static TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer);

@Rule
public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment
= new TenantApplicationSecurityEnvironmentTestRule(testEnvironment);
@@ -16,6 +16,7 @@
package io.mifos.anubis.suites;

import io.mifos.core.test.env.TestEnvironment;
import io.mifos.core.test.fixture.TenantDataStoreContextTestRule;
import io.mifos.core.test.fixture.cassandra.CassandraInitializer;
import org.junit.ClassRule;
import org.junit.rules.RuleChain;
@@ -28,11 +29,13 @@
public class SuiteTestEnvironment {
public static final String APP_NAME = "anubis-v1";

static protected TestEnvironment testEnvironment = new TestEnvironment(APP_NAME);
static protected CassandraInitializer cassandraInitializer = new CassandraInitializer();
protected final static TestEnvironment testEnvironment = new TestEnvironment(APP_NAME);
protected final static CassandraInitializer cassandraInitializer = new CassandraInitializer();
private final static TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer);

@ClassRule
public static TestRule orderClassRules = RuleChain
.outerRule(new RunExternalResourceOnce(testEnvironment))
.around(new RunExternalResourceOnce(cassandraInitializer));
}
.around(new RunExternalResourceOnce(cassandraInitializer))
.around(tenantDataStoreContext);
}

0 comments on commit aef0c51

Please sign in to comment.