Search in sources :

Example 1 with KieServerControllerHTTPClientException

use of org.kie.server.controller.client.exception.KieServerControllerHTTPClientException in project kie-wb-common by kiegroup.

the class StandaloneControllerIT method testEmbeddedRestEndpoint.

@Test
@RunAsClient
@OperateOnDeployment("workbench")
public void testEmbeddedRestEndpoint(@ArquillianResource final URL baseURL) throws Exception {
    final String controllerURL = baseURL + "rest/controller";
    try {
        KieServerControllerClient client = KieServerControllerClientFactory.newRestClient(controllerURL, USER, PASSWORD);
        client.listServerTemplates();
        fail("Connection to embedded controller endpoint should fail");
    } catch (KieServerControllerHTTPClientException ex) {
        assertEquals(404, ex.getResponseCode());
    }
}
Also used : KieServerControllerClient(org.kie.server.controller.client.KieServerControllerClient) KieServerControllerHTTPClientException(org.kie.server.controller.client.exception.KieServerControllerHTTPClientException) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)1 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)1 Test (org.junit.Test)1 KieServerControllerClient (org.kie.server.controller.client.KieServerControllerClient)1 KieServerControllerHTTPClientException (org.kie.server.controller.client.exception.KieServerControllerHTTPClientException)1