org.springframework.http.HttpStatus.ACCEPTED

Here are the examples of the java api org.springframework.http.HttpStatus.ACCEPTED taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

198 Examples 7

19 Source : ResponseEntityPro.java
with Apache License 2.0
from yujunhao8831

public static <T> ResponseEnreplacedy<T> accepted(final T body, final String filterFields) {
    if (null == filterFields || WILDCARD_ALL.equals(filterFields)) {
        return accepted(body);
    }
    return status(HttpStatus.ACCEPTED, body, filterFields);
}

19 Source : ResponseEntityPro.java
with Apache License 2.0
from yujunhao8831

public static ResponseEnreplacedy<String> accepted() {
    return status(HttpStatus.ACCEPTED, HttpStatus.ACCEPTED.getReasonPhrase());
}

19 Source : ResponseEntityPro.java
with Apache License 2.0
from yujunhao8831

public static <T> ResponseEnreplacedy<T> accepted(final T body) {
    return status(HttpStatus.ACCEPTED, body);
}

19 Source : DefaultServerResponseBuilderTests.java
with MIT License
from Vip-Augus

@Test
public void accepted() {
    ServerResponse response = ServerResponse.accepted().build();
    replacedertEquals(HttpStatus.ACCEPTED, response.statusCode());
}

19 Source : DefaultServerResponseBuilderTests.java
with MIT License
from Vip-Augus

@Test
public void statusCode() {
    HttpStatus statusCode = HttpStatus.ACCEPTED;
    ServerResponse response = ServerResponse.status(statusCode).build();
    replacedertEquals(statusCode, response.statusCode());
}

19 Source : DefaultServerResponseBuilderTests.java
with MIT License
from Vip-Augus

@Test
public void accepted() {
    Mono<ServerResponse> result = ServerResponse.accepted().build();
    StepVerifier.create(result).expectNextMatches(response -> HttpStatus.ACCEPTED.equals(response.statusCode())).expectComplete().verify();
}

19 Source : DefaultServerResponseBuilderTests.java
with MIT License
from Vip-Augus

@Test
public void statusCode() {
    HttpStatus statusCode = HttpStatus.ACCEPTED;
    Mono<ServerResponse> result = ServerResponse.status(statusCode).build();
    StepVerifier.create(result).expectNextMatches(response -> statusCode.equals(response.statusCode())).expectComplete().verify();
}

19 Source : StatusResultMatchers.java
with MIT License
from Vip-Augus

/**
 * replacedert the response status code is {@code HttpStatus.ACCEPTED} (202).
 */
public ResultMatcher isAccepted() {
    return matcher(HttpStatus.ACCEPTED);
}

19 Source : StatusAssertions.java
with MIT License
from Vip-Augus

/**
 * replacedert the response status code is {@code HttpStatus.ACCEPTED} (202).
 */
public WebTestClient.ResponseSpec isAccepted() {
    return replacedertStatusAndReturn(HttpStatus.ACCEPTED);
}

19 Source : CredentialITCase.java
with Apache License 2.0
from syndesisio

@Test
public void shouldInitiateCredentialFlow() throws UnsupportedEncodingException {
    final ResponseEnreplacedy<AcquisitionResponse> acquisitionResponse = post("/api/v1/connectors/test-provider/credentials", Collections.singletonMap("returnUrl", "/ui#state"), AcquisitionResponse.clreplaced, tokenRule.validToken(), HttpStatus.ACCEPTED);
    replacedertThat(acquisitionResponse.hasBody()).as("Should present a acquisition response in the HTTP body").isTrue();
    final AcquisitionResponse response = acquisitionResponse.getBody();
    replacedertThat(response.getType()).isEqualTo(Type.OAUTH2);
    final String redirectUrl = response.getRedirectUrl();
    replacedertThat(redirectUrl).as("Should redirect to Salesforce and containthe correct callback URL").startsWith("https://test/oauth2/authorize?client_id=testClientId&response_type=code&redirect_uri=").contains(encode("/api/v1/credentials/callback", "ASCII"));
    final MultiValueMap<String, String> params = UriComponentsBuilder.fromHttpUrl(redirectUrl).build().getQueryParams();
    final String state = params.getFirst("state");
    replacedertThat(state).as("state parameter should be set").isNotEmpty();
    final State responseStateInstruction = response.state();
    replacedertThat(responseStateInstruction).as("acquisition response should contain the state instruction").isNotNull();
    replacedertThat(responseStateInstruction.persist()).isEqualByComparingTo(State.Persist.COOKIE);
    replacedertThat(responseStateInstruction.spec()).isNotEmpty();
    final CredentialFlowState credentialFlowState = clientSideState.restoreFrom(Cookie.valueOf(responseStateInstruction.spec()), CredentialFlowState.clreplaced);
    final CredentialFlowState expected = new OAuth2CredentialFlowState.Builder().key("test-state").providerId("test-provider").build();
    replacedertThat(credentialFlowState).as("The flow state should be as expected").isEqualToIgnoringGivenFields(expected, "returnUrl");
    final URI returnUrl = credentialFlowState.getReturnUrl();
    replacedertThat(returnUrl).isNotNull();
    replacedertThat(returnUrl.isAbsolute()).isTrue();
    replacedertThat(returnUrl.getPath()).isEqualTo("/ui");
    replacedertThat(returnUrl.getFragment()).isEqualTo("state");
}

19 Source : DefaultServerResponseBuilderTests.java
with Apache License 2.0
from SourceHot

@Test
public void accepted() {
    ServerResponse response = ServerResponse.accepted().build();
    replacedertThat(response.statusCode()).isEqualTo(HttpStatus.ACCEPTED);
}

19 Source : DefaultServerResponseBuilderTests.java
with Apache License 2.0
from SourceHot

@Test
public void statusCode() {
    HttpStatus statusCode = HttpStatus.ACCEPTED;
    ServerResponse response = ServerResponse.status(statusCode).build();
    replacedertThat(response.statusCode()).isEqualTo(statusCode);
}

19 Source : AsyncResponseEntity.java
with Apache License 2.0
from quebic-source

public static <T> AsyncResponseEnreplacedy<T> accepted() {
    return AsyncResponseEnreplacedy.status(HttpStatus.ACCEPTED);
}

19 Source : JobManagementSpringResource.java
with Apache License 2.0
from Netflix

@ApiOperation("Create a job")
@PostMapping(path = "/jobs")
public ResponseEnreplacedy<JobId> createJob(@RequestBody JobDescriptor jobDescriptor, CallMetadataAuthentication authentication) {
    String jobId = Responses.fromSingleValueObservable(jobServiceGateway.createJob(jobDescriptor, authentication.getCallMetadata()));
    return ResponseEnreplacedy.status(HttpStatus.ACCEPTED).body(JobId.newBuilder().setId(jobId).build());
}

19 Source : RoomServiceTest.java
with GNU General Public License v3.0
from mwinteringham

@Test
public void updateRoomTest() throws SQLException {
    Room sampleRoom = new Room(105, "Twin", true, "image1", "Room description", new String[] { "a", "b", "c" }, 123);
    when(authRequests.postCheckAuth("abc")).thenReturn(true);
    when(roomDB.update(1, sampleRoom)).thenReturn(sampleRoom);
    RoomResult roomResult = roomService.updateRoom(1, sampleRoom, "abc");
    replacedertEquals(roomResult.getHttpStatus(), HttpStatus.ACCEPTED);
    replacedertEquals(roomResult.getRoom().toString(), "Room{roomid=0, roomNumber=105, type='Twin', accessible=true, image='image1', description='Room description', features=[a, b, c], roomPrice=123}");
}

19 Source : MessageServiceTest.java
with GNU General Public License v3.0
from mwinteringham

@Test
public void markMessageAsReadTest() throws SQLException {
    when(authRequests.postCheckAuth("abc")).thenReturn(true);
    doNothing().when(messageDB).markAsRead(1);
    HttpStatus messageStatus = messageService.markAsRead(1, "abc");
    replacedertEquals(messageStatus, HttpStatus.ACCEPTED);
}

19 Source : BookingServiceTest.java
with GNU General Public License v3.0
from mwinteringham

@Test
public void deleteBookingTest() throws SQLException {
    when(authRequests.postCheckAuth("abc123")).thenReturn(true);
    when(bookingDB.delete(1)).thenReturn(true);
    HttpStatus bookingResult = bookingService.deleteBooking(1, "abc123");
    replacedertEquals(bookingResult, HttpStatus.ACCEPTED);
}

19 Source : ReceiveEventSteps.java
with Apache License 2.0
from citrusframework

/**
 * Receives cloud event as Http request.
 * @param request
 */
private void receiveEvent(HttpMessage request) {
    kubernetesSteps.receiveServiceRequest(request, MessageType.JSON);
    kubernetesSteps.sendServiceResponse(HttpStatus.ACCEPTED);
}

19 Source : WiremockAccountInformationRequest.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_accounts_for_anton_brueckner_ip_address_compute() {
    ExtractableResponse<Response> response = // FIX HEADERS
    withAccountsHeaders(ANTON_BRUECKNER).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).header(COMPUTE_PSU_IP_ADDRESS, true).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : WiremockAccountInformationRequest.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_accounts_for_anton_brueckner_no_ip_address() {
    ExtractableResponse<Response> response = // FIX HEADERS
    withAccountsHeaders(ANTON_BRUECKNER).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).header(COMPUTE_PSU_IP_ADDRESS, false).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : RequestCommon.java
with Apache License 2.0
from adorsys

protected ExtractableResponse<Response> user_provides_sca_challenge_result() {
    return provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, readResource("restrecord/tpp-ui-input/params/new-user-sca-challenge-result.json"), HttpStatus.ACCEPTED);
}

19 Source : RequestCommon.java
with Apache License 2.0
from adorsys

protected ExtractableResponse<Response> max_musterman_provides_sca_challenge_result() {
    return provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, readResource("restrecord/tpp-ui-input/params/max-musterman-sca-challenge-result.json"), HttpStatus.ACCEPTED);
}

19 Source : RequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_logged_in_into_opba_as_opba_user_with_credentials_using_fintech_supplied_url(String username, String preplacedword, String path) {
    String fintechUserTempPreplacedword = UriComponentsBuilder.fromHttpUrl(redirectUriToGetUserParams).build().getQueryParams().getFirst(REDIRECT_CODE_QUERY);
    ExtractableResponse<Response> response = Restreplacedured.given().header(X_REQUEST_ID, UUID.randomUUID().toString()).contentType(MediaType.APPLICATION_JSON_VALUE).queryParam(REDIRECT_CODE_QUERY, fintechUserTempPreplacedword).body(ImmutableMap.of(LOGIN, username, PreplacedWORD, preplacedword)).when().post(path, serviceSessionId).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    this.authSessionCookie = response.cookie(AUTHORIZATION_SESSION_KEY);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_accounts_for_anton_brueckner(String bankId, boolean online) {
    ExtractableResponse<Response> response = withAccountsHeaders(ANTON_BRUECKNER, bankId).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).queryParam(ONLINE, online).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_provided_initial_parameters_with_correct_iban_to_list_transactions_with_single_account_consent() {
    String resource = "restrecord/tpp-ui-input/params/max-musterman-transactions-single-account-consent.json";
    ExtractableResponse<Response> response = startInitialInternalConsentAuthorization(AUTHORIZE_CONSENT_ENDPOINT, readResource(resource), HttpStatus.ACCEPTED);
    replacedertThat(this.redirectUriToGetUserParams).contains("authenticate").contains("wrong=false");
    updateServiceSessionId(response);
    updateRedirectCode(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

// Note that max.musterman is typically used for EMBEDDED (real EMBEDDED that is returned by bank, and not EMBEDDED approach in table)
public SELF fintech_calls_list_accounts_for_max_musterman(String bankId) {
    ExtractableResponse<Response> response = withAccountsHeaders(MAX_MUSTERMAN, bankId).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_provided_wrong_sca_challenge_result_to_embedded_authorization_and_redirected_to_select_sca() {
    ExtractableResponse<Response> response = provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, readResource("restrecord/tpp-ui-input/params/max-musterman-wrong-sca-challenge-result.json"), HttpStatus.ACCEPTED);
    replacedertThat(LocationExtractorUtil.getLocation(response)).contains("select-sca-method");
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_transactions_for_max_musterman(String resourceId, String bankId, boolean online) {
    ExtractableResponse<Response> response = withTransactionsHeaders(MAX_MUSTERMAN, bankId).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).queryParam(ONLINE, online).when().get(AIS_TRANSACTIONS_ENDPOINT, resourceId).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_provided_wrong_sca_challenge_result_to_embedded_authorization_and_stays_on_sca_page() {
    ExtractableResponse<Response> response = provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, readResource("restrecord/tpp-ui-input/params/max-musterman-wrong-sca-challenge-result.json"), HttpStatus.ACCEPTED);
    replacedertThat(LocationExtractorUtil.getLocation(response)).contains("sca-result").contains("/EMAIL").contains("wrong=true");
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_accounts_for_user(String user) {
    ExtractableResponse<Response> response = withAccountsHeaders(user).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_selected_sca_challenge_type_photo_otp_to_embedded_authorization() {
    provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, selectedScaBody("PHOTO_OTP:photo_otp"), HttpStatus.ACCEPTED);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

// Note that max.musterman is typically used for EMBEDDED (real EMBEDDED that is returned by bank, and not EMBEDDED approach in table)
public SELF fintech_calls_list_accounts_for_max_musterman_with_expected_balances(Boolean withBalance) {
    ExtractableResponse<Response> response = withAccountsHeaders(MAX_MUSTERMAN).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).queryParam("withBalance", withBalance).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_selected_sca_challenge_type_email2_to_embedded_authorization() {
    provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, selectedScaBody("EMAIL:[email protected]"), HttpStatus.ACCEPTED);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_transactions_for_anton_brueckner() {
    ExtractableResponse<Response> response = withTransactionsHeaders(ANTON_BRUECKNER).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).when().get(AIS_TRANSACTIONS_WITHOUT_RESOURCE_ID_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_selected_sca_challenge_type_email1_to_embedded_authorization() {
    provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, selectedScaBody("EMAIL:[email protected]"), HttpStatus.ACCEPTED);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_accounts_for_max_musterman_missing_ip_address() {
    ExtractableResponse<Response> response = withAccountsHeadersMissingIpAddress(MAX_MUSTERMAN).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).when().get(AIS_ACCOUNTS_ENDPOINT).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_provided_wrong_preplacedword_to_embedded_authorization_and_stays_on_preplacedword_page() {
    ExtractableResponse<Response> response = provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, readResource("restrecord/tpp-ui-input/params/max-musterman-wrong-preplacedword.json"), HttpStatus.ACCEPTED);
    replacedertThat(LocationExtractorUtil.getLocation(response)).contains("authenticate").contains("wrong=true");
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_selected_sca_challenge_type_email1_to_embedded_authorization() {
    provideParametersToBankingProtocolWithBody(AUTHORIZE_CONSENT_ENDPOINT, selectedScaBody("EMAIL:[email protected]"), HttpStatus.ACCEPTED);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

protected ExtractableResponse<Response> startInitialInternalConsentAuthorization(String uriPath, String resourceData) {
    ExtractableResponse<Response> response = startInitialInternalConsentAuthorization(uriPath, resourceData, HttpStatus.ACCEPTED);
    updateServiceSessionId(response);
    updateRedirectCode(response);
    return response;
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF fintech_calls_list_transactions_for_user(String user, String resourceId) {
    ExtractableResponse<Response> response = withTransactionsHeaders(user).header(SERVICE_SESSION_ID, UUID.randomUUID().toString()).when().get(AIS_TRANSACTIONS_ENDPOINT, resourceId).then().statusCode(HttpStatus.ACCEPTED.value()).extract();
    updateServiceSessionId(response);
    updateRedirectCode(response);
    updateNextConsentAuthorizationUrl(response);
    return self();
}

19 Source : AccountInformationRequestCommon.java
with Apache License 2.0
from adorsys

public SELF user_max_musterman_provided_initial_parameters_with_wrong_iban_to_list_transactions_with_single_account_consent() {
    String resource = "restrecord/tpp-ui-input/params/max-musterman-dedicated-account-consent-wrong-iban.json";
    ExtractableResponse<Response> response = startInitialInternalConsentAuthorization(AUTHORIZE_CONSENT_ENDPOINT, readResource(resource), HttpStatus.ACCEPTED);
    replacedertThat(this.redirectUriToGetUserParams).contains("ais").contains("entry-consent-transactions/dedicated-account-access").contains("wrong=true");
    updateServiceSessionId(response);
    updateRedirectCode(response);
    return self();
}

19 Source : BasicOpenBankingStartupTest.java
with Apache License 2.0
from adorsys

@Test
void testXs2aProtocolIsWiredForSandboxTransactionList() {
    xs2aTransactionList(HttpStatus.ACCEPTED);
    verify(xs2aListTransactionsEntrypoint).execute(any());
}

19 Source : BasicOpenBankingStartupTest.java
with Apache License 2.0
from adorsys

@Test
void testXs2aProtocolIsWiredForPayments() {
    xs2aPaymentCreate(HttpStatus.ACCEPTED);
    verify(xs2aInitiateSinglePaymentEntrypoint).execute(any());
}

19 Source : BasicOpenBankingStartupTest.java
with Apache License 2.0
from adorsys

@Test
void testXs2aProtocolIsWiredForSandboxAccountList() {
    xs2aAccountList(HttpStatus.ACCEPTED);
    verify(xs2aListAccountsEntrypoint).execute(any());
}

19 Source : BasicOpenBankingStartupTest.java
with Apache License 2.0
from adorsys

@Test
void testXs2aProtocolIsWiredForPaymentsGetStatus() {
    xs2aPaymentStatusGet(HttpStatus.ACCEPTED);
    verify(xs2aGetPaymentStatusEntrypoint).execute(any());
}

18 Source : RequestMappingHandlerAdapterIntegrationTests.java
with MIT License
from Vip-Augus

@Test
public void handleHttpEnreplacedy() throws Exception {
    Clreplaced<?>[] parameterTypes = new Clreplaced<?>[] { HttpEnreplacedy.clreplaced };
    request.addHeader("Content-Type", "text/plain; charset=utf-8");
    request.setContent("Hello Server".getBytes("UTF-8"));
    HandlerMethod handlerMethod = handlerMethod("handleHttpEnreplacedy", parameterTypes);
    ModelAndView mav = handlerAdapter.handle(request, response, handlerMethod);
    replacedertNull(mav);
    replacedertEquals(HttpStatus.ACCEPTED.value(), response.getStatus());
    replacedertEquals("Handled requestBody=[Hello Server]", new String(response.getContentAsByteArray(), "UTF-8"));
    replacedertEquals("headerValue", response.getHeader("header"));
    // set because of @SesstionAttributes
    replacedertEquals("no-store", response.getHeader("Cache-Control"));
}

18 Source : RequestMappingHandlerAdapterIntegrationTests.java
with MIT License
from Vip-Augus

@Test
public void handleAndValidateRequestBody() throws Exception {
    Clreplaced<?>[] parameterTypes = new Clreplaced<?>[] { TestBean.clreplaced, Errors.clreplaced };
    request.addHeader("Content-Type", "text/plain; charset=utf-8");
    request.setContent("Hello Server".getBytes("UTF-8"));
    HandlerMethod handlerMethod = handlerMethod("handleAndValidateRequestBody", parameterTypes);
    ModelAndView mav = handlerAdapter.handle(request, response, handlerMethod);
    replacedertNull(mav);
    replacedertEquals("Error count [1]", new String(response.getContentAsByteArray(), "UTF-8"));
    replacedertEquals(HttpStatus.ACCEPTED.value(), response.getStatus());
}

18 Source : OrderController.java
with Apache License 2.0
from SpringCloud

@Override
public ResponseEnreplacedy executeCancel(String txId) {
    UserOrder userOrder = orderDao.findByTxId(txId);
    if (userOrder == null) {
        // return ResponseEnreplacedy.notFound().build();
        return ResponseEnreplacedy.status(HttpStatus.ACCEPTED).build();
    }
    userOrder.setState(OrderState.CANCELED);
    orderDao.save(userOrder);
    return ResponseEnreplacedy.status(HttpStatus.ACCEPTED).build();
}

18 Source : WebClientDataBufferAllocatingTests.java
with Apache License 2.0
from SourceHot

// SPR-17482
@ParameterizedDataBufferAllocatingTest
void bodyToMonoVoidWithoutContentType(String displayName, DataBufferFactory bufferFactory) {
    setUp(bufferFactory);
    this.server.enqueue(new MockResponse().setResponseCode(HttpStatus.ACCEPTED.value()).setChunkedBody("{\"foo\" : \"123\",  \"baz\" : \"456\", \"baz\" : \"456\"}", 5));
    Mono<Map<String, String>> mono = this.webClient.get().uri("/sample").accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(new ParameterizedTypeReference<Map<String, String>>() {
    });
    StepVerifier.create(mono).expectError(UnsupportedMediaTypeException.clreplaced).verify(Duration.ofSeconds(3));
    replacedertThat(this.server.getRequestCount()).isEqualTo(1);
}

18 Source : UserController.java
with Apache License 2.0
from quebic-source

@RequestMapping(method = RequestMethod.PUT)
public AsyncResponseEnreplacedy<User> update(@ModelAttribute User user) {
    return makeAsyncResponse(userService.edit(user, new UserImageDto()).map(i -> {
        publishMessage(i.getId(), i);
        return i;
    }), HttpStatus.ACCEPTED);
}

See More Examples