package com.github.kohanyirobert.mongoroid;

import org.junit.After;
import org.junit.Before;

public abstract class AbstractMongoConnectionSimpleSingleTest {

  protected MongoConnection connection;

  protected AbstractMongoConnectionSimpleSingleTest() {}

  // @do-not-check DesignForExtension
  @Before
  public void setUp() throws MongoException {
    connection = MongoConnections.builder()
        .config(MongoConfigs.builder()
            .poolSize(1)
            .build())
        .seed(MongoSeeds.builder()
            // @do-not-check MagicNumber
            .address(27018)
            .address(27019)
            .address(27020)
            .build())
        .build();
    connection.database("admin").login("admin", "admin");
  }

  // @do-not-check DesignForExtension
  @After
  public void tearDown() throws MongoException {
    connection.database("test").collection("test").remove(MongoRemoves.get());
    connection.close();
  }
}

@@ -734,16 +734,369 @@
 dmin%22);%0A
+    // there's a very vague issue with logins and sockets because as I've%0A    // noticed that if a communication goes through a socket which is%0A    // resolved as %22127.0.0.1%22 mongodb grants read-write permission for every%0A    // database with an admin login, but not otherwise (not confirmed tho')%0A    connection.database(%22test%22).login(%22test%22, %22test%22);%0A
   %7D%0A%0A  /

Update the setup method of the abstract base test.