Search in sources :

Example 11 with WildflyClientException

use of org.guvnor.ala.wildfly.access.exceptions.WildflyClientException in project kie-wb-common by kiegroup.

the class WildflyClientServiceImplTest method testTestConnectionFailed.

@Test
public void testTestConnectionFailed() {
    when(wfClient.testConnection()).thenThrow(new WildflyClientException(ERROR_MESSAGE));
    TestConnectionResult result = wildflyClientService.testConnection(DUMMY_VALUE, DUMMY_INT_VALUE, DUMMY_INT_VALUE, DUMMY_VALUE, DUMMY_VALUE);
    assertTrue(result.getManagementConnectionError());
    assertEquals(ERROR_MESSAGE, result.getManagementConnectionMessage());
}
Also used : WildflyClientException(org.guvnor.ala.wildfly.access.exceptions.WildflyClientException) TestConnectionResult(org.guvnor.ala.ui.wildfly.service.TestConnectionResult) Test(org.junit.Test)

Aggregations

WildflyClientException (org.guvnor.ala.wildfly.access.exceptions.WildflyClientException)11 IOException (java.io.IOException)6 AuthScope (org.apache.http.auth.AuthScope)6 UsernamePasswordCredentials (org.apache.http.auth.UsernamePasswordCredentials)6 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)6 HttpPost (org.apache.http.client.methods.HttpPost)6 BasicCredentialsProvider (org.apache.http.impl.client.BasicCredentialsProvider)6 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)6 ModelNode (org.jboss.dmr.ModelNode)6 HttpResponse (org.apache.http.HttpResponse)5 CredentialsProvider (org.apache.http.client.CredentialsProvider)5 StringEntity (org.apache.http.entity.StringEntity)5 RuntimeOperationException (org.guvnor.ala.exceptions.RuntimeOperationException)4 WildflyRuntime (org.guvnor.ala.wildfly.model.WildflyRuntime)4 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Date (java.util.Date)1 HttpEntity (org.apache.http.HttpEntity)1