Polish sample package names
This commit is contained in:
@@ -29,7 +29,6 @@ public class SampleMongoApplication implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
|
||||
this.repository.deleteAll();
|
||||
|
||||
// save a couple of customers
|
||||
@@ -54,10 +53,10 @@ public class SampleMongoApplication implements CommandLineRunner {
|
||||
for (Customer customer : this.repository.findByLastName("Smith")) {
|
||||
System.out.println(customer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleMongoApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.junit.Test;
|
||||
import org.springframework.boot.test.OutputCapture;
|
||||
import org.springframework.core.NestedCheckedException;
|
||||
|
||||
import com.mongodb.MongoServerSelectionException;
|
||||
import com.mongodb.MongoTimeoutException;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -61,8 +60,7 @@ public class SampleMongoApplicationTests {
|
||||
NestedCheckedException nested = new NestedCheckedException("failed", ex) {
|
||||
};
|
||||
Throwable root = nested.getRootCause();
|
||||
if (root instanceof MongoServerSelectionException
|
||||
|| root instanceof MongoTimeoutException) {
|
||||
if (root instanceof MongoTimeoutException) {
|
||||
if (root.getMessage().contains("Unable to connect to any server")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user