本文整理汇总了Java中org.apache.cxf.jaxrs.client.WebClient.path方法的典型用法代码示例。如果您正苦于以下问题:Java WebClient.path方法的具体用法?Java WebClient.path怎么用?Java WebClient.path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.jaxrs.client.WebClient
的用法示例。
在下文中一共展示了WebClient.path方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test200searchAllUsers
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test200searchAllUsers() {
final String TEST_NAME = "test200searchAllUsers";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient();
client.path("/users/search");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.post(new QueryType());
TestUtil.displayThen(TEST_NAME);
displayResponse(response);
assertStatus(response, 200);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例2: testEntitledAttributesJSON
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void testEntitledAttributesJSON() {
if (!waitForWADL()) {
return;
}
WebClient client = WebClient.create(ENDPOINT_ADDRESS);
client.header("Authorization", "Basic YWRtaW46YWRtaW4=");
client.type("application/json");
client.accept("application/json");
client.path("entitled-attribs");
String request = readReource("json/request-entitled-attribs-1.json");
String response = readReource("json/response-entitled-attribs-1.json");
String webRespose = client.post(request, String.class);
assertEquals(response, webRespose);
}
示例3: test018GetUserAdministratorByCyclops
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test018GetUserAdministratorByCyclops() {
final String TEST_NAME = "test018GetUserAdministratorByCyclops";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_CYCLOPS_USERNAME, USER_CYCLOPS_PASSWORD);
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 403);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例4: test003getUserAdministratorByEgoist
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
/**
* egoist doesn't have authorization to read other object. ot has only end user role,
* so he is allowed to performed defined actions on his own.
*/
@Test
public void test003getUserAdministratorByEgoist() {
final String TEST_NAME = "test003getUserAdministratorByEgoist";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_EGOIST_OID);
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 403);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例5: test131GetUserAdministratorByDarthAdder
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test131GetUserAdministratorByDarthAdder() {
final String TEST_NAME = "test131GetUserAdministratorByDarthAdder";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD);
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 403);
assertNoEmptyResponse(response);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(1);
getDummyAuditService().assertFailedLogin(SchemaConstants.CHANNEL_REST_URI);
}
示例6: test141GetUserAdministratorByNopasswordBadPassword
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test141GetUserAdministratorByNopasswordBadPassword() {
final String TEST_NAME = "test140GetUserAdministratorByNopassword";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_NOPASSWORD_USERNAME, "bad");
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 403);
assertNoEmptyResponse(response);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(1);
getDummyAuditService().assertFailedLogin(SchemaConstants.CHANNEL_REST_URI);
}
示例7: test004getUserSelfByHead
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
/**
* user head is a super user and has also rest authorization so he can perform any action
*/
@Test
public void test004getUserSelfByHead() {
final String TEST_NAME = "test004getUserSelfByHead";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(null);
client.path("/self");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 200);
UserType userType = response.readEntity(UserType.class);
assertNotNull("Returned entity in body must not be null.", userType);
LOGGER.info("Returned entity: {}", userType.asPrismObject().debugDump());
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例8: testAllEntitlementsXML
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void testAllEntitlementsXML() {
if (!waitForWADL()) {
return;
}
WebClient client = WebClient.create(ENDPOINT_ADDRESS);
client.header("Authorization", "Basic YWRtaW46YWRtaW4=");
client.type("application/xml");
client.accept("application/xml");
client.path("entitlements-all");
String request = readReource("xml/request-all-entitlements-1.xml");
String response = readReource("xml/response-all-entitlements-1.xml");
String webRespose = client.post(request, String.class);
assertEquals(response, webRespose);
}
示例9: testAllEntitlementsJSON
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void testAllEntitlementsJSON() {
if (!waitForWADL()) {
return;
}
WebClient client = WebClient.create(ENDPOINT_ADDRESS);
client.header("Authorization", "Basic YWRtaW46YWRtaW4=");
client.type("application/json");
client.accept("application/json");
client.path("entitlements-all");
String request = readReource("json/request-all-entitlements-1.json");
String response = readReource("json/response-all-entitlements-1.json");
String webRespose = client.post(request, String.class);
assertEquals(response, webRespose);
}
示例10: test103AddUserBadTargetCollection
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test103AddUserBadTargetCollection() throws Exception {
final String TEST_NAME = "test103AddUserBadTargetCollection";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient();
client.path("/objectTemplates");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.post(getRepoFile(USER_DARTHADDER_FILE));
TestUtil.displayThen(TEST_NAME);
displayResponse(response);
assertStatus(response, 400);
OperationResultType result = response.readEntity(OperationResultType.class);
assertNotNull("Error response must contain operation result", result);
LOGGER.info("Returned result: {}", result);
assertEquals("Unexpected operation result status", OperationResultStatusType.FATAL_ERROR, result.getStatus());
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例11: test004GetAuthBadUsernameNullPassword
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test004GetAuthBadUsernameNullPassword() {
final String TEST_NAME = "test004GetAuthBadUsernameNullPassword";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient("NoSUCHuser", null);
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 401);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(1);
getDummyAuditService().assertFailedLogin(SchemaConstants.CHANNEL_REST_URI);
}
示例12: test135AddUserNopasswordAsDarthAdder
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test135AddUserNopasswordAsDarthAdder() throws Exception {
final String TEST_NAME = "test135AddUserNopasswordAsDarthAdder";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD);
client.path("/users");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.post(getRepoFile(USER_NOPASSWORD_FILE));
TestUtil.displayThen(TEST_NAME);
displayResponse(response);
assertStatus(response, 201);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(4);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
getDummyAuditService().assertHasDelta(1, ChangeType.ADD, UserType.class);
}
示例13: test007GetAuthNoPassword
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test007GetAuthNoPassword() {
final String TEST_NAME = "test007GetAuthNoPassword";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient(USER_ADMINISTRATOR_USERNAME, null);
client.path("/users/" + SystemObjectsType.USER_ADMINISTRATOR.value());
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.get();
TestUtil.displayThen(TEST_NAME);
assertStatus(response, 401);
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(1);
getDummyAuditService().assertFailedLogin(SchemaConstants.CHANNEL_REST_URI);
}
示例14: test513validateValueImplicitMulti
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test513validateValueImplicitMulti() throws Exception {
final String TEST_NAME = "test513validateValueImplicitMulti";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient();
client.path("/users/" + USER_DARTHADDER_OID + "/validate");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_MULTI));
TestUtil.displayThen(TEST_NAME);
displayResponse(response);
traceResponse(response);
assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus());
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(2);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
}
示例15: test104AddAccountRawResourceDoesNotExist
import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
@Test
public void test104AddAccountRawResourceDoesNotExist() throws Exception {
final String TEST_NAME = "test104AddAccountRaw";
displayTestTile(this, TEST_NAME);
WebClient client = prepareClient();
client.path("/shadows");
client.query("options", "raw");
getDummyAuditService().clear();
TestUtil.displayWhen(TEST_NAME);
Response response = client.post(getRepoFile(ACCOUT_CHUCK_FILE));
TestUtil.displayThen(TEST_NAME);
displayResponse(response);
// expecting hadnled error because resource doesn't exist.. it is OK, but let's say admin about that
assertStatus(response, 240);
OperationResult addResult = traceResponse(response);
assertNotNull("Expected operation result in the response, but nothing in the body", addResult);
assertEquals("Unexpected status of the operation result. Expected "+ OperationResultStatus.HANDLED_ERROR + ", but was " + addResult.getStatus(), addResult.getStatus(), OperationResultStatus.HANDLED_ERROR);
OperationResult parentResult = new OperationResult("get");
try {
getProvisioning().getObject(ShadowType.class, ACCOUT_CHUCK_OID,
SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null,
parentResult);
fail("expected object not found exception but haven't got one.");
} catch (ObjectNotFoundException ex) {
// this is OK..we expect objet not found, because accout was added
// with the raw options which indicates, that it was created only in
// the repository
}
IntegrationTestTools.display("Audit", getDummyAuditService());
getDummyAuditService().assertRecords(4);
getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI);
getDummyAuditService().assertHasDelta(1, ChangeType.ADD, ShadowType.class);
}