Skip to content

Commit

Permalink
♻️ [Test] Improvements on readyness checks of resources
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Jan 21, 2025
1 parent 4153140 commit bb131df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.eclipse.kapua.qa.common.BasicSteps;
import org.eclipse.kapua.qa.common.DBHelper;
import org.eclipse.kapua.qa.common.StepData;
import org.eclipse.kapua.qa.integration.steps.utils.TestReadinessConnection;
import org.eclipse.kapua.qa.integration.steps.utils.TestReadinessHttpConnection;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
Expand Down Expand Up @@ -715,8 +715,8 @@ private void waitJobEngineContainer(String name) throws Exception{
* @since 2.1.0
*/
private boolean isJobEngineContainerReady(String name) throws Exception {
try (TestReadinessConnection testReadinessConnection = new TestReadinessConnection(JOB_ENGINE_ADDRESS_EXTERNAL)){
return testReadinessConnection.isReady();
try (TestReadinessHttpConnection testReadinessHttpConnection = new TestReadinessHttpConnection(JOB_ENGINE_ADDRESS_EXTERNAL)){
return testReadinessHttpConnection.isReady();
}
catch (Exception e) {
// Ignoring...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @since 2.1.0
*/
public class TestReadinessConnection implements AutoCloseable {
public class TestReadinessHttpConnection implements AutoCloseable {

private final HttpURLConnection testReadinessConnection;
private final int readyResponseCode;
Expand All @@ -33,7 +33,7 @@ public class TestReadinessConnection implements AutoCloseable {
* @throws Exception
* @since 2.1.0
*/
public TestReadinessConnection(String testUrl) throws Exception {
public TestReadinessHttpConnection(String testUrl) throws Exception {
this(testUrl, 200);
}

Expand All @@ -43,10 +43,10 @@ public TestReadinessConnection(String testUrl) throws Exception {
*
* @param testUrl The HTTP URL to check for readiness
* @param readyResponseCode Which HTTP response code consider valid for readiness
* @throws Exception
* @throws IOException
* @since 2.1.0
*/
public TestReadinessConnection(String testUrl, int readyResponseCode) throws IOException {
public TestReadinessHttpConnection(String testUrl, int readyResponseCode) throws IOException {
URL testReadinessURL = new URL(testUrl);

testReadinessConnection = (HttpURLConnection) testReadinessURL.openConnection();
Expand Down

0 comments on commit bb131df

Please sign in to comment.