Here are the examples of the java api org.apache.http.HttpStatus.SC_BAD_REQUEST taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
584 Examples
19
Source : HttpResponseTests.java
with Apache License 2.0
from vividus-framework
with Apache License 2.0
from vividus-framework
@ParameterizedTest
@ValueSource(ints = { HttpStatus.SC_OK, HttpStatus.SC_CREATED, HttpStatus.SC_BAD_REQUEST })
void testVerifyOneStatusCodeInRangeSuccess(Integer code) {
httpResponse.setStatusCode(code);
HttpResponse actual = httpResponse.verifyStatusCodeInRange(HttpStatus.SC_OK, HttpStatus.SC_BAD_REQUEST);
replacedertThat(actual, Matchers.equalTo(httpResponse));
}
19
Source : HttpResponseTests.java
with Apache License 2.0
from vividus-framework
with Apache License 2.0
from vividus-framework
@ParameterizedTest
@ValueSource(ints = { HttpStatus.SC_PROCESSING, HttpStatus.SC_UNAUTHORIZED, HttpStatus.SC_GATEWAY_TIMEOUT })
void testVerifyStatusCodeException(int code) {
httpResponse.setStatusCode(code);
String expectedMessage = String.format(EXCEPTION_MSG_IN_RANGE, code, HttpStatus.SC_OK, HttpStatus.SC_BAD_REQUEST);
ExternalServiceException exception = replacedertThrows(ExternalServiceException.clreplaced, () -> httpResponse.verifyStatusCodeInRange(HttpStatus.SC_OK, HttpStatus.SC_BAD_REQUEST));
replacedertEquals(expectedMessage, exception.getMessage());
}
19
Source : HttpResponseTests.java
with Apache License 2.0
from vividus-framework
with Apache License 2.0
from vividus-framework
@ParameterizedTest
@ValueSource(ints = { HttpStatus.SC_PROCESSING, HttpStatus.SC_UNAUTHORIZED, HttpStatus.SC_GATEWAY_TIMEOUT })
void testVerifyOneStatusCodeInRangeException(int code) {
httpResponse.setStatusCode(code);
String expectedMessage = String.format(EXCEPTION_MSG_IN_RANGE, code, HttpStatus.SC_OK, HttpStatus.SC_BAD_REQUEST);
ExternalServiceException exception = replacedertThrows(ExternalServiceException.clreplaced, () -> httpResponse.verifyStatusCodeInRange(HttpStatus.SC_OK, HttpStatus.SC_BAD_REQUEST));
replacedertEquals(expectedMessage, exception.getMessage());
}
19
Source : AuthApiTest.java
with Apache License 2.0
from stargate
with Apache License 2.0
from stargate
@Test
public void auth_MissingCredentials() throws IOException {
String body = RestUtils.post("", String.format("%s:8081/v1/auth", host), "", HttpStatus.SC_BAD_REQUEST);
Error error = objectMapper.readValue(body, Error.clreplaced);
replacedertThat(error.getDescription()).isEqualTo("Must provide a body to the request");
}
19
Source : AuthApiTest.java
with Apache License 2.0
from stargate
with Apache License 2.0
from stargate
@Test
public void authUsernameToken_MissingUsername() throws IOException {
String body = RestUtils.post("", String.format("%s:8081/v1/admin/auth/usernametoken", host), "", HttpStatus.SC_BAD_REQUEST);
Error error = objectMapper.readValue(body, Error.clreplaced);
replacedertThat(error.getDescription()).isEqualTo("Must provide a body to the request");
}
19
Source : AuthApiTest.java
with Apache License 2.0
from stargate
with Apache License 2.0
from stargate
@Test
public void authTokenGenerate_MissingSecret() throws IOException {
String body = RestUtils.post("", String.format("%s:8081/v1/auth/token/generate", host), "", HttpStatus.SC_BAD_REQUEST);
Error error = objectMapper.readValue(body, Error.clreplaced);
replacedertThat(error.getDescription()).isEqualTo("Must provide a body to the request");
}
19
Source : ScmFileTransferServlet.java
with MIT License
from scm-manager
with MIT License
from scm-manager
private void readBlobFromResponse(HttpServletRequest request, HttpServletResponse response, AnyLongObjectId objectId) throws IOException {
Blob blob = blobStore.create(objectId.getName());
try (OutputStream blobOutputStream = blob.getOutputStream();
ServletInputStream requestInputStream = request.getInputStream()) {
IOUtil.copy(requestInputStream, blobOutputStream);
blob.commit();
response.setContentType(Constants.CONTENT_TYPE_GIT_LFS_JSON);
response.setStatus(HttpServletResponse.SC_OK);
} catch (CorruptLongObjectException ex) {
sendErrorAndLog(response, HttpStatus.SC_BAD_REQUEST, ex);
}
}
19
Source : PropPatchTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* CellレベルPROPPATCHでpropタグが不正な場合の削除テスト.
*/
@Test
public final void CellレベルPROPPATCHでpropタグが不正な場合の削除テスト() {
String token = AbstractCase.MASTER_TOKEN_NAME;
// PROPPATCH設定実行
DavResourceUtils.resetProppatchSetPropKey(TEST_CELL1, token, HttpStatus.SC_BAD_REQUEST, "props");
}
19
Source : PropPatchTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* CellレベルPROPPATCHでpropタグが不正な場合の更新テスト.
*/
@Test
public final void CellレベルPROPPATCHでpropタグが不正な場合の更新テスト() {
String token = AbstractCase.MASTER_TOKEN_NAME;
String author1 = "Test User1";
String hoge1 = "Hoge";
// PROPPATCH設定実行
DavResourceUtils.setProppatchSetPropKey(TEST_CELL1, token, HttpStatus.SC_BAD_REQUEST, "props", author1, hoge1);
}
19
Source : LogListTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* アーカイブログファイル一覧取得_ボディ不正な形式のXMLを指定したPROPFINDで400が返却されること.
*/
@Test
public final void アーカイブログファイル一覧取得_ボディ不正な形式のXMLを指定したPROPFINDで400が返却されること() {
// 最初の要素のとじカッコがないXMLをボディに指定する
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?" + "<D:propfind xmlns:D=\"DAV:\"><D:allprop/></D:propfind>";
Http.request("cell/log-propfind-with-body.txt").with("METHOD", io.personium.common.utils.CommonUtils.HttpMethod.PROPFIND).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL_EVENTLOG).with("collection", ARCHIVE_COLLECTION).with("depth", "0").with("body", body).returns().statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : LogListTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* アーカイブログファイル一覧取得_ボディに不正なプロパティが指定さた場合400が返却されること.
*/
@Test
public final void アーカイブログファイル一覧取得_ボディに不正なプロパティが指定さた場合400が返却されること() {
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<D:propfind xmlns:D=\"DAV:\"><D:hoge/></D:propfind>";
Http.request("cell/log-propfind-with-body.txt").with("METHOD", io.personium.common.utils.CommonUtils.HttpMethod.PROPFIND).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL_EVENTLOG).with("collection", ARCHIVE_COLLECTION).with("depth", "1").with("body", body).returns().debug().statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : LogListTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* アーカイブログファイル一覧取得_Depthヘッダの指定がない場合に400が返却されること.
*/
@Test
public final void アーカイブログファイル一覧取得_Depthヘッダの指定がない場合に400が返却されること() {
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<D:propfind xmlns:D=\"DAV:\"><D:allprop/></D:propfind>";
Http.request("cell/log-propfind-with-body-no-depth.txt").with("METHOD", io.personium.common.utils.CommonUtils.HttpMethod.PROPFIND).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL_EVENTLOG).with("collection", ARCHIVE_COLLECTION).with("body", body).returns().statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : LogListTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* アーカイブログファイル一覧取得_ボディにallpropが指定されないPROPFINDで400が返却されること.
*/
@Test
public final void アーカイブログファイル一覧取得_ボディにallpropが指定されないPROPFINDで400が返却されること() {
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<D:propfind xmlns:D=\"DAV:\"></D:propfind>";
Http.request("cell/log-propfind-with-body.txt").with("METHOD", io.personium.common.utils.CommonUtils.HttpMethod.PROPFIND).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL_EVENTLOG).with("collection", ARCHIVE_COLLECTION).with("depth", "1").with("body", body).returns().debug().statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : LogListTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* アーカイブログファイル一覧取得_Depthヘッダに0または1以外の数値を指定した場合に400が返却されること.
*/
@Test
public final void アーカイブログファイル一覧取得_Depthヘッダに0または1以外の数値を指定した場合に400が返却されること() {
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<D:propfind xmlns:D=\"DAV:\"><D:allprop/></D:propfind>";
Http.request("cell/log-propfind-with-body.txt").with("METHOD", io.personium.common.utils.CommonUtils.HttpMethod.PROPFIND).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL_EVENTLOG).with("collection", ARCHIVE_COLLECTION).with("depth", "100").with("body", body).returns().debug().statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : EventTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* イベント受付時のrequestKeyヘッダに不正文字を含めた値を指定しPOSTした場合400が返却されること.
*/
@Test
public final void イベント受付時のrequestKeyヘッダに不正文字を含めた値を指定しPOSTした場合400が返却されること() {
TResponse response = Http.request("cell/cell-event.txt").with("METHOD", HttpMethod.POST).with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", Setup.TEST_CELL1).with("requestKey", "abc#123").with("json", "").returns();
response.checkErrorResponse("PR400-EV-0002", PersoniumCoreException.Event.X_PERSONIUM_REQUESTKEY_INVALID.getMessage());
response.statusCode(HttpStatus.SC_BAD_REQUEST);
}
19
Source : DeleteTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Cell名にクオート無しの数値型式名を指定した場合400エラーとなること.
*/
@Test
public final void Cell名にクオート無しの数値型式名を指定した場合400エラーとなること() {
// $format なし
// Acceptヘッダ なし
String cellName = "123456";
String url = getUrlWithOutQuote(cellName, null);
PersoniumResponse res = this.restDelete(url);
replacedertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode());
checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.ENreplacedY_KEY_PARSE_ERROR.getCode(), PersoniumCoreException.OData.ENreplacedY_KEY_PARSE_ERROR.getMessage());
}
19
Source : RoleUpdateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Roleの更新でボディに存在しないBox名を指定した場合400が返却されること.
*/
@Test
public void Roleの更新でボディに存在しないBox名を指定した場合400が返却されること() {
String boxname = "dummy";
try {
// 登録
createRoleAndCheckResponse(false);
// 更新
TResponse res = Http.request("role-update.txt").with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", cellName).with("rolenamekey", testRoleName).with("boxnamekey", "null").with("rolename", testRoleName).with("boxname", "\"" + boxname + "\"").returns().debug().statusCode(HttpStatus.SC_BAD_REQUEST);
// メッセージ確認
ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage());
} finally {
CellCtlUtils.deleteRole(cellName, testRoleName);
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録のテスト_リクエストボディに管理情報__metadataを指定した場合400エラーとなる確認.
*/
@Test
public void ROLE新規登録のテスト_リクエストボディに管理情報__metadataを指定した場合400エラーとなる確認() {
errCreateRole("box1", METADATA, null, HttpStatus.SC_BAD_REQUEST);
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameにスラッシュを含む文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameにスラッシュを含む文字列を指定した場合400になること() {
String roleName = "test/Role";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameにアンダーバー始まりの文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameにアンダーバー始まりの文字列を指定した場合400になること() {
String roleName = "_testRole";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameに存在しないBox名を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時に存在しないBox名を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "dummy";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
// メッセージ確認
ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage());
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameに129文字指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameに129文字指定した場合400になること() {
String roleName = "1234567890123456789012345678901234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890123456789012345678x";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameに空文字を指定して400になること.
*/
@Test
public final void ROLE新規登録時にNameに空文字を指定した場合400になること() {
String roleName = "";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameに日本語を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名に日本語を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "日本語";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録のテスト_リクエストボディに管理情報__updatedを指定した場合400エラーとなる確認.
*/
@Test
public void ROLE新規登録のテスト_リクエストボディに管理情報__updatedを指定した場合400エラーとなる確認() {
errCreateRole("box1", UPDATED, "/Date(0)/", HttpStatus.SC_BAD_REQUEST);
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録のテスト_リクエストボディに管理情報__publishedを指定した場合400エラーとなる確認.
*/
@Test
public void ROLE新規登録のテスト_リクエストボディに管理情報__publishedを指定した場合400エラーとなる確認() {
errCreateRole("box1", PUBLISHED, "/Date(0)/", HttpStatus.SC_BAD_REQUEST);
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameに日本語を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameに日本語を指定した場合400になること() {
String roleName = "日本語";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameに空文字を指定して400になること.
*/
@Test
public final void ROLE新規登録時にBox名に空文字を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameにハイフン始まりの文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameにハイフン始まりの文字列を指定した場合400になること() {
String roleName = "-testRole";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時にNameに__ctlを指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にNameに__ctlを指定した場合400になること() {
String roleName = "__ctl";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameに129文字指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名に129文字指定した場合400になること() {
String roleName = testRoleName;
String boxname = "1234567890123456789012345678901234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890123456789012345678x";
String locationHeader = null;
String locationHeaderBox = null;
try {
// Box作成
PersoniumResponse resBox = createBox(boxname);
locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION);
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
if (locationHeaderBox != null) {
CellCtlUtils.deleteOdataResource(locationHeaderBox);
}
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameにスラッシュを含む文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名にスラッシュを含む文字列を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "box/1";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameにアンダーバー始まりの文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名にアンダーバー始まりの文字列を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "_box";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameに__ctlを指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名に__ctlを指定した場合400になること() {
String roleName = testRoleName;
String boxname = "__ctl";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RoleCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* ROLE新規登録時に_Box.Nameにハイフン始まりの文字列を指定した場合400になること.
*/
@Test
public final void ROLE新規登録時にBox名にハイフン始まりの文字列を指定した場合400になること() {
String roleName = testRoleName;
String boxname = "-box";
String locationHeader = null;
try {
TResponse res = createTestRole(roleName, boxname, HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
CellCtlUtils.deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationUpdateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relationの更新でボディに存在しないBox名を指定した場合400が返却されること.
*/
@Test
public void Relationの更新でボディに存在しないBox名を指定した場合400が返却されること() {
String boxname = "dummy";
try {
// 登録
createRelationAndCheckResponse(false);
// 更新
TResponse res = Http.request("relation-update.txt").with("token", AbstractCase.MASTER_TOKEN_NAME).with("cellPath", cellName).with("relationname", testRelationName).with("boxname", "null").with("updateName", testRelationName).with("updateBoxName", "\"" + boxname + "\"").returns().debug().statusCode(HttpStatus.SC_BAD_REQUEST);
// メッセージ確認
ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage());
} finally {
CellCtlUtils.deleteRelation(cellName, testRelationName);
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameに日本語を指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameに日本語を指定した場合400になること() {
String relationName = "日本語";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameに指定可能な文字数の最大値をオーバー指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameに指定可能な文字数の最大値をオーバー指定した場合400になること() {
String relationName = "1234567890123456789012345678901234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890123456789012345678x";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameにコロン始まりの文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameにコロン始まりの文字列を指定した場合400になること() {
String relationName = ":testRelation";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録のテスト_リクエストボディに管理情報__metadataを指定した場合400エラーとなる確認.
*/
@Test
public void Relation新規登録のテスト_リクエストボディに管理情報__metadataを指定した場合400エラーとなる確認() {
errCreateRelation("box1", METADATA, null, HttpStatus.SC_BAD_REQUEST);
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameにアンダーバー始まりの文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameにアンダーバー始まりの文字列を指定した場合400になること() {
String relationName = "_testRelation";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時_Box.Nameにアンダーバー始まりの文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Box名にアンダーバー始まりの文字列を指定した場合400になること() {
String relationName = testRelationName;
String boxname = "_boxname";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameに空文字を指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameに空文字を指定した場合400になること() {
String relationName = "";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時_Box.Nameに__ctlを指定した場合400になること.
*/
@Test
public void Relation新規登録時Box名に__ctlを指定した場合400になること() {
String relationName = testRelationName;
String boxname = "__ctl";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameに__ctlを指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameに__ctlを指定した場合400になること() {
String relationName = "__ctl";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時_Box.Nameにスラッシュを含む文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Box名にスラッシュを含む文字列を指定した場合400になること() {
String relationName = testRelationName;
String boxname = "box/name";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録のテスト_リクエストボディに管理情報__publishedを指定した場合400エラーとなる確認.
*/
@Test
public void Relation新規登録のテスト_リクエストボディに管理情報__publishedを指定した場合400エラーとなる確認() {
errCreateRelation("box1", PUBLISHED, "/Date(0)/", HttpStatus.SC_BAD_REQUEST);
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時_Box.Nameに空文字を指定した場合400になること.
*/
@Test
public void Relation新規登録時Box名に空文字を指定した場合400になること() {
String relationName = testRelationName;
String boxname = "";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時_Box.Nameにハイフン始まりの文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Box名にハイフン始まりの文字列を指定した場合400になること() {
String relationName = testRelationName;
String boxname = "-boxname";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
19
Source : RelationCreateTest.java
with Apache License 2.0
from personium
with Apache License 2.0
from personium
/**
* Relation新規登録時Nameにスラッシュを含む文字列を指定した場合400になること.
*/
@Test
public void Relation新規登録時Nameにスラッシュを含む文字列を指定した場合400になること() {
String relationName = "test/Relation";
String boxname = "box1";
String locationHeader = null;
try {
TResponse res = createRelation(relationName, boxname);
res.statusCode(HttpStatus.SC_BAD_REQUEST);
locationHeader = res.getLocationHeader();
} finally {
if (locationHeader != null) {
deleteOdataResource(locationHeader);
}
}
}
See More Examples