Skip to content
Snippets Groups Projects
Commit d556e4f2 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7346 Cleanup code

parent 485937cf
Branches
No related tags found
No related merge requests found
...@@ -51,12 +51,12 @@ class ElasticsearchRemoteServiceITCase { ...@@ -51,12 +51,12 @@ class ElasticsearchRemoteServiceITCase {
private final ElasticsearchRemoteService service = new ElasticsearchRemoteService(client); private final ElasticsearchRemoteService service = new ElasticsearchRemoteService(client);
@BeforeAll @BeforeAll
public static void startContainer() { static void startContainer() {
ElasticsearchTestClient.ELASTICSEARCH_CONTAINER.start(); ElasticsearchTestClient.ELASTICSEARCH_CONTAINER.start();
} }
@AfterAll @AfterAll
public static void stopContainer() { static void stopContainer() {
ElasticsearchTestClient.ELASTICSEARCH_CONTAINER.stop(); ElasticsearchTestClient.ELASTICSEARCH_CONTAINER.stop();
} }
...@@ -70,7 +70,7 @@ class ElasticsearchRemoteServiceITCase { ...@@ -70,7 +70,7 @@ class ElasticsearchRemoteServiceITCase {
@SneakyThrows @SneakyThrows
@BeforeEach @BeforeEach
public void initIndex() { void initIndex() {
createIndex(); createIndex();
} }
...@@ -125,7 +125,7 @@ class ElasticsearchRemoteServiceITCase { ...@@ -125,7 +125,7 @@ class ElasticsearchRemoteServiceITCase {
@SneakyThrows @SneakyThrows
@BeforeEach @BeforeEach
public void initSecurityRole() { void initSecurityRole() {
createIndex(); createIndex();
client.security().putRole(service.createPutRoleRequest(PutRoleRequestDataTestFactory.create())); client.security().putRole(service.createPutRoleRequest(PutRoleRequestDataTestFactory.create()));
} }
...@@ -170,7 +170,7 @@ class ElasticsearchRemoteServiceITCase { ...@@ -170,7 +170,7 @@ class ElasticsearchRemoteServiceITCase {
@SneakyThrows @SneakyThrows
@BeforeEach @BeforeEach
private void initSecurityUser() { void initSecurityUser() {
createIndex(); createIndex();
client.security().putUser(service.createPutUserRequest(PutUserRequestDataTestFactory.create())); client.security().putUser(service.createPutUserRequest(PutUserRequestDataTestFactory.create()));
} }
......
...@@ -48,11 +48,9 @@ public class ElasticsearchTestClient { ...@@ -48,11 +48,9 @@ public class ElasticsearchTestClient {
private static final Duration STARTUP_TIMEOUT = Duration.of(2, ChronoUnit.MINUTES); private static final Duration STARTUP_TIMEOUT = Duration.of(2, ChronoUnit.MINUTES);
public static final ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer(IMAGE_NAME) public static final ElasticsearchContainer ELASTICSEARCH_CONTAINER = new ElasticsearchContainer(IMAGE_NAME)
.withAccessToHost(true)
.withExposedPorts(PORT) .withExposedPorts(PORT)
.withPassword(PASSWORD) .withPassword(PASSWORD)
.withStartupTimeout(STARTUP_TIMEOUT); .withStartupTimeout(STARTUP_TIMEOUT);
// .withMinimumRunningDuration(Duration.ofMinutes(2));
public static ElasticsearchClient create() { public static ElasticsearchClient create() {
var transport = new RestClientTransport(buildRestClient(), new JacksonJsonpMapper()); var transport = new RestClientTransport(buildRestClient(), new JacksonJsonpMapper());
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment