|
29 | 29 | import org.bson.types.MaxKey; |
30 | 30 | import org.bson.types.MinKey; |
31 | 31 | import org.bson.types.ObjectId; |
| 32 | +import org.testng.SkipException; |
32 | 33 | import org.testng.annotations.Test; |
33 | 34 |
|
34 | 35 | import java.net.UnknownHostException; |
@@ -653,6 +654,10 @@ public void testMulti(){ |
653 | 654 |
|
654 | 655 | @Test |
655 | 656 | public void testAuthenticate() throws UnknownHostException { |
| 657 | + if (serverIsAtLeastVersion(2.5)) { |
| 658 | + throw new SkipException("Authentication tests skipped for 2.5 and up"); |
| 659 | + } |
| 660 | + |
656 | 661 | assertEquals( "26e3d12bd197368526409177b3e8aab6" , _db._hash( "e" , "j".toCharArray() ) ); |
657 | 662 |
|
658 | 663 | Mongo m = new MongoClient(); |
@@ -689,6 +694,10 @@ public void testAuthenticate() throws UnknownHostException { |
689 | 694 |
|
690 | 695 | @Test |
691 | 696 | public void testAuthenticateCommand() throws UnknownHostException { |
| 697 | + if (serverIsAtLeastVersion(2.5)) { |
| 698 | + throw new SkipException("Authentication tests skipped for 2.5 and up"); |
| 699 | + } |
| 700 | + |
692 | 701 | Mongo m = new MongoClient(); |
693 | 702 | DB db = m.getDB(cleanupDB); |
694 | 703 | DBCollection usersCollections = db.getCollection( "system.users" ); |
@@ -753,6 +762,10 @@ public void testAuthenticateWithCredentialsInURIAndNoDatabase() throws UnknownHo |
753 | 762 |
|
754 | 763 | @Test |
755 | 764 | public void testAuthenticateWithCredentialsInURI() throws UnknownHostException { |
| 765 | + if (serverIsAtLeastVersion(2.5)) { |
| 766 | + throw new SkipException("Authentication tests skipped for 2.5 and up"); |
| 767 | + } |
| 768 | + |
756 | 769 | // First add the user |
757 | 770 | Mongo m = new MongoClient(new MongoClientURI("mongodb://localhost")); |
758 | 771 | DB db = m.getDB(cleanupDB); |
@@ -783,6 +796,10 @@ public void testAuthenticateWithCredentialsInURI() throws UnknownHostException { |
783 | 796 |
|
784 | 797 | @Test |
785 | 798 | public void testAuthenticateCommandWithCredentialsInURI() throws UnknownHostException { |
| 799 | + if (serverIsAtLeastVersion(2.5)) { |
| 800 | + throw new SkipException("Authentication tests skipped for 2.5 and up"); |
| 801 | + } |
| 802 | + |
786 | 803 | // First add the user |
787 | 804 | Mongo m = new MongoClient(new MongoClientURI("mongodb://localhost")); |
788 | 805 | DB db = m.getDB(cleanupDB); |
|
0 commit comments