Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit 36bc363

Browse files
authored
Merge pull request #221 from lazara3/octane-dev-latest
US #832077: [Jenkins] Add support for 'test connection' and blocking …
2 parents a15a759 + 0d9007f commit 36bc363

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
<dependency>
471471
<artifactId>integrations-sdk</artifactId>
472472
<groupId>com.hpe.adm.octane.ciplugins</groupId>
473-
<version>2.0.56</version>
473+
<version>2.0.62</version>
474474
</dependency>
475475

476476
<!--BUILDER providers integration-->

src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationValidator.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
package com.microfocus.application.automation.tools.octane.configuration;
2222

2323
import com.hp.octane.integrations.OctaneSDK;
24-
import com.hp.octane.integrations.dto.connectivity.OctaneResponse;
24+
import com.hp.octane.integrations.exceptions.OctaneConnectivityException;
2525
import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl;
2626
import com.microfocus.application.automation.tools.octane.Messages;
2727
import hudson.ProxyConfiguration;
@@ -100,20 +100,14 @@ public static FormValidation checkConfigurationAndWrapWithFormValidation(String
100100
}
101101

102102
public static void checkConfiguration(List<String> errorMessages, String location, String sharedSpace, String username, Secret password) {
103-
OctaneResponse checkResponse;
103+
104104
try {
105-
checkResponse = OctaneSDK.testOctaneConfiguration(location, sharedSpace, username, password.getPlainText(), CIJenkinsServicesImpl.class);
106-
107-
if (checkResponse.getStatus() == 401) {
108-
errorMessages.add(Messages.AuthenticationFailure());
109-
} else if (checkResponse.getStatus() == 403) {
110-
errorMessages.add(Messages.AuthorizationFailure());
111-
} else if (checkResponse.getStatus() == 404) {
112-
errorMessages.add(Messages.ConnectionSharedSpaceInvalid());
113-
} else if (checkResponse.getStatus() != 200) {
114-
errorMessages.add(Messages.UnexpectedFailure() + ": " + checkResponse.getStatus());
115-
}
116-
} catch (IOException ioe) {
105+
OctaneSDK.testAndValidateOctaneConfiguration(location, sharedSpace, username, password.getPlainText(), CIJenkinsServicesImpl.class);
106+
107+
} catch (OctaneConnectivityException octaneException) {
108+
errorMessages.add(octaneException.getErrorMessageVal());
109+
110+
}catch (IOException ioe) {
117111
logger.warn("Connection check failed due to communication problem", ioe);
118112
errorMessages.add(Messages.ConnectionFailure());
119113
}

0 commit comments

Comments
 (0)