Merge branch '1.3.x'
This commit is contained in:
@@ -16,11 +16,16 @@
|
||||
|
||||
package sample.data.cassandra;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.cassandraunit.spring.CassandraDataSet;
|
||||
import org.cassandraunit.spring.EmbeddedCassandra;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.model.Statement;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
@@ -44,10 +49,35 @@ public class SampleCassandraApplicationTests {
|
||||
@ClassRule
|
||||
public static OutputCapture outputCapture = new OutputCapture();
|
||||
|
||||
@ClassRule
|
||||
public static SkipOnWindows skipOnWindows = new SkipOnWindows();
|
||||
|
||||
@Test
|
||||
public void testDefaultSettings() throws Exception {
|
||||
String output = SampleCassandraApplicationTests.outputCapture.toString();
|
||||
assertThat(output).contains("firstName='Alice', lastName='Smith'");
|
||||
}
|
||||
|
||||
static class SkipOnWindows implements TestRule {
|
||||
|
||||
@Override
|
||||
public Statement apply(final Statement base, Description description) {
|
||||
return new Statement() {
|
||||
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
if (!runningOnWindows()) {
|
||||
base.evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean runningOnWindows() {
|
||||
return File.separatorChar == '\\';
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user