Skip to content

Commit 5381b4d

Browse files
committed
Added additional tests
1 parent 32cfd12 commit 5381b4d

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

tests/common/src/test/java/tech/ydb/test/integration/DockerHelperFactoryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public void tlsDockerContainerTests() {
161161
YdbEnvironmentMock env = new YdbEnvironmentMock()
162162
.withUseTLS(true)
163163
.withToken("SIMPLE_TOKEN")
164+
.withFeatures("enable_views")
164165
.withDockerReuse(false);
165166

166167
YdbMockContainer container = new YdbMockContainer(env, ports);

tests/common/src/test/java/tech/ydb/test/integration/YdbEnvironmentMock.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ public class YdbEnvironmentMock extends YdbEnvironment {
99
private String endpoint = null;
1010
private String pemCert = null;
1111
private String token = null;
12+
private String features = null;
1213
private boolean useTLS = false;
1314
private boolean dockerReuse = false;
1415
private boolean dockerIsolation = false;
16+
private boolean disabledTests = false;
1517

1618
public YdbEnvironmentMock withDatabase(String value) {
1719
this.database = value;
@@ -43,11 +45,21 @@ public YdbEnvironmentMock withDockerReuse(boolean value) {
4345
return this;
4446
}
4547

48+
public YdbEnvironmentMock withFeatures(String features) {
49+
this.features = features;
50+
return this;
51+
}
52+
4653
public YdbEnvironmentMock withDockerIsolation(boolean value) {
4754
this.dockerIsolation = value;
4855
return this;
4956
}
5057

58+
public YdbEnvironmentMock withTestDisabled(boolean value) {
59+
this.disabledTests = value;
60+
return this;
61+
}
62+
5163
@Override
5264
public String ydbDatabase() {
5365
return database;
@@ -78,13 +90,18 @@ public boolean dockerReuse() {
7890
return dockerReuse;
7991
}
8092

93+
@Override
94+
public String dockerFeatures() {
95+
return features;
96+
}
97+
8198
@Override
8299
public boolean useDockerIsolation() {
83100
return dockerIsolation;
84101
}
85102

86103
@Override
87104
public boolean disableIntegrationTests() {
88-
return false;
105+
return disabledTests;
89106
}
90107
}

tests/common/src/test/java/tech/ydb/test/integration/YdbHelperFactoryTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ public void cleanup() {
2929
transportMock.close();
3030
}
3131

32+
@Test
33+
public void disabledDockerTest() {
34+
YdbEnvironmentMock env = new YdbEnvironmentMock()
35+
.withTestDisabled(true);
36+
37+
YdbHelperFactory factory = YdbHelperFactory.createYdbHelper(env);
38+
39+
Assert.assertNotNull("check disabled factory instance", factory);
40+
Assert.assertFalse("check disabled factory instance", factory.isEnabled());
41+
Assert.assertNull("check disabled factory instance", factory.createHelper());
42+
}
43+
3244
@Test
3345
public void externalNonTlsInstanceTest() {
3446
transportMock.setup("/database");

0 commit comments

Comments
 (0)