testcontainers

Can't connect to a testcontainer Neo4J instance?

北城以北 提交于 2021-02-11 08:11:11
问题 this is my test class: @Testcontainers @ReactiveDataNeo4jTest internal class RepositoryIT { @Container private val container = KNeo4jContainer.instance @Test fun `should answer with One`() { val boltUrl = container.getBoltUrl() GraphDatabase.driver( boltUrl, AuthTokens.basic("neo4j", "123456")) .use { driver -> driver.session().use { session -> val res = session.run("OPTIONAL MATCH(n) RETURN 1 AS value") val one = res.single().get("value").asInt() assertThat(one).isEqualTo(2) } } } } object

Can't connect to a testcontainer Neo4J instance?

感情迁移 提交于 2021-02-11 08:09:48
问题 this is my test class: @Testcontainers @ReactiveDataNeo4jTest internal class RepositoryIT { @Container private val container = KNeo4jContainer.instance @Test fun `should answer with One`() { val boltUrl = container.getBoltUrl() GraphDatabase.driver( boltUrl, AuthTokens.basic("neo4j", "123456")) .use { driver -> driver.session().use { session -> val res = session.run("OPTIONAL MATCH(n) RETURN 1 AS value") val one = res.single().get("value").asInt() assertThat(one).isEqualTo(2) } } } } object

Can't connect to a testcontainer Neo4J instance?

梦想与她 提交于 2021-02-11 08:09:20
问题 this is my test class: @Testcontainers @ReactiveDataNeo4jTest internal class RepositoryIT { @Container private val container = KNeo4jContainer.instance @Test fun `should answer with One`() { val boltUrl = container.getBoltUrl() GraphDatabase.driver( boltUrl, AuthTokens.basic("neo4j", "123456")) .use { driver -> driver.session().use { session -> val res = session.run("OPTIONAL MATCH(n) RETURN 1 AS value") val one = res.single().get("value").asInt() assertThat(one).isEqualTo(2) } } } } object

Can't connect to a testcontainer Neo4J instance?

对着背影说爱祢 提交于 2021-02-11 08:08:39
问题 this is my test class: @Testcontainers @ReactiveDataNeo4jTest internal class RepositoryIT { @Container private val container = KNeo4jContainer.instance @Test fun `should answer with One`() { val boltUrl = container.getBoltUrl() GraphDatabase.driver( boltUrl, AuthTokens.basic("neo4j", "123456")) .use { driver -> driver.session().use { session -> val res = session.run("OPTIONAL MATCH(n) RETURN 1 AS value") val one = res.single().get("value").asInt() assertThat(one).isEqualTo(2) } } } } object

Calling thirdparty container with .net core TestHost/TestServer via SSL: Bypass SSL Validation using Testservers CreateClient() method

别等时光非礼了梦想. 提交于 2021-02-11 08:02:20
问题 I am trying to add keycloak as a testcontainer to my .net core (5) integration tests using the dotnet-testcontainers library . My Problem is, I am struggling with HTTPS-Support having a container using self-signed certificates and TestServer-Class for my integration tests. To be precise, I am using Microsofts TestServer class to create real API requests with an in-memory config for using a keycloak-testcontainer with exposed port 8443 and its self-signed certificate. The Problem is: I can’t

Better way to set testcontainer properties from default applicaton.yml in springboottest

流过昼夜 提交于 2021-01-29 14:16:04
问题 I am using posgresql testcontainer in springboottest. As I have multiple tests involving this testcontainer, hence I have used static testcontainer which will be invoked once for all tests of 1 junit class and shutdown after all tests are executed. This I have implemented using ParameterResolver, BeforeEachCallback. Problem with this approach is that datasource metadata like jdbc-url, db name , host , port configured in default application.yml is not used directly in testcontainer properties,

How to test repository with junit5 and testcontainers?

六月ゝ 毕业季﹏ 提交于 2021-01-29 08:12:19
问题 I have a sample project in which I experiment with different technologies. I have the following setup: Spring Boot 2.3.4.RELEASE Flyway 7.0.1 Testcontainers 1.15.0-rc2 Junit 5.7.0 How can I test the Repository layer with testcontainer-junit5? Example of code I have now for CompanyRepositoryTest.java : @ExtendWith(SpringExtension.class) @Testcontainers public class CompanyRepositoryTest { @Autowired private CompanyRepository companyRepository; @Container public MySQLContainer mysqlContainer =

Integration testing with Testcontainers + Quarkus + MongoDB

筅森魡賤 提交于 2020-12-05 12:10:36
问题 Trying out testcontainers for integration testing. I am testing rest api endpoint. Here is the technology stack - quarkus, RESTEasy and mongodb-client I am able to see MongoDB container is started successfully but getting exception. Exception: "com.mongodb.MongoSocketOpenException: Exception opening socket" 2020-04-26 15:13:18,330 INFO [org.tes.doc.DockerClientProviderStrategy] (main) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties,

Mongo in testcontainers

∥☆過路亽.° 提交于 2020-07-23 08:05:07
问题 I started playing with testcontainers and at the beginning of my journey I faced some issue (below). I did similar thing for mysql db and it worked fine. Do I miss some mongo specific config? According to [docs][1] there is not much to do. Thanks in advance for any tips / examples. com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70) ~[mongodb-driver-core-3.11.2.jar:na] at com.mongodb.internal.connection