Best Testcontainers-java code snippet using org.testcontainers.containers.InfluxDBContainerWithUserTest.checkVersion
Source:InfluxDBContainerWithUserTest.java
...21 Assert.assertThat(actual, CoreMatchers.notNullValue());22 Assert.assertThat(actual.describeDatabases(), CoreMatchers.hasItem(InfluxDBContainerWithUserTest.DATABASE));23 }24 @Test25 public void checkVersion() {26 InfluxDB actual = influxDBContainer.getNewInfluxDB();27 Assert.assertThat(actual, CoreMatchers.notNullValue());28 Assert.assertThat(actual.ping(), CoreMatchers.notNullValue());29 Assert.assertThat(actual.ping().getVersion(), CoreMatchers.is(InfluxDBContainerWithUserTest.TEST_VERSION));30 Assert.assertThat(actual.version(), CoreMatchers.is(InfluxDBContainerWithUserTest.TEST_VERSION));31 }32 @Test33 public void queryForWriteAndRead() {34 InfluxDB influxDB = influxDBContainer.getNewInfluxDB();35 Point point = Point.measurement("cpu").time(System.currentTimeMillis(), TimeUnit.MILLISECONDS).addField("idle", 90L).addField("user", 9L).addField("system", 1L).build();36 influxDB.write(point);37 Query query = new Query("SELECT idle FROM cpu", InfluxDBContainerWithUserTest.DATABASE);38 QueryResult actual = influxDB.query(query);39 Assert.assertThat(actual, CoreMatchers.notNullValue());...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!