Java源码示例:play.mvc.Call

示例1
@Before
public void setUp() throws Exception {
    final Call callToResetPasswordUrl = mock(Call.class);
    when(callToResetPasswordUrl.absoluteURL(any())).thenReturn(RESET_PASSWORD_URL);
    when(fakeRecoverPasswordReverseRouter.resetPasswordPageCall(TOKEN_VALUE)).thenReturn(callToResetPasswordUrl);
    when(fakeResetPasswordToken.getValue()).thenReturn(TOKEN_VALUE);
    Http.Context.current.set(mock(Http.Context.class));
}
 
示例2
/**
 * {@inheritDoc}
 * It uses as product identifier the product slug for the current locale and as variant identifier the SKU.
 */
@Override
public Optional<Call> productDetailPageCall(final io.sphere.sdk.shoppinglists.LineItem lineItem) {
    return Optional.ofNullable(lineItem.getProductSlug())
            .flatMap(slugs -> slugs.find(locale())
                    .map(slug -> productDetailPageCall(slug, lineItem.getVariant().getSku())));
}
 
示例3
private BreadcrumbLinkViewModel createCategoryLinkData(final Category category) {
    final BreadcrumbLinkViewModel linkViewModel = new BreadcrumbLinkViewModel();
    linkViewModel.setText(category.getName());
    linkViewModel.setUrl(productReverseRouter
            .productOverviewPageCall(category)
            .map(Call::url)
            .orElse(""));
    return linkViewModel;
}
 
示例4
protected void appendStatementLanguageSelection(HtmlTemplate template, String currentLanguage, Set<String> allowedLanguages, Call target) {
    template.transformContent(c -> statementLanguageSelectionLayout.render(target.absoluteURL(Controller.request(), Controller.request().secure()), allowedLanguages, currentLanguage, c));
}
 
示例5
protected void fillOrderUrl(final OrderOverviewViewModel viewModel, final Order order) {
    viewModel.setShowOrderUrl(myOrdersReverseRouter
            .myOrderDetailPageCall(order)
            .map(Call::url)
            .orElse(""));
}
 
示例6
protected void fillAddressEditUrl(final EditableAddressViewModel viewModel, final Address address) {
    viewModel.setAddressEditUrl(addressBookReverseRouter.changeAddressPageCall(address).map(Call::url).orElse(""));
}
 
示例7
protected void fillAddressDeleteUrl(final EditableAddressViewModel viewModel, final Address address) {
    viewModel.setAddressDeleteUrl(addressBookReverseRouter.removeAddressProcessCall(address).map(Call::url).orElse(""));
}
 
示例8
protected void fillUrl(final ProductVariantReferenceViewModel viewModel, final ProductWithVariant productWithVariant) {
    viewModel.setUrl(productReverseRouter
            .productDetailPageCall(productWithVariant.getProduct(), productWithVariant.getVariant())
            .map(Call::url)
            .orElse(""));
}
 
示例9
@Override
public Call removeAddressProcessCall(final String languageTag, final String addressIdentifier) {
    return delegate.removeAddressProcessCall(languageTag, addressIdentifier);
}
 
示例10
default Call myPersonalDetailsProcessCall() {
    return myPersonalDetailsProcessCall(locale().toLanguageTag());
}
 
示例11
default Call addDiscountCodeProcessCall() {
    return addDiscountCodeProcessCall(locale().toLanguageTag());
}
 
示例12
default Call removeDiscountCodeProcessCall() {
    return removeDiscountCodeProcessCall(locale().toLanguageTag());
}
 
示例13
@Override
public Call logOutProcessCall(final String languageTag) {
    return delegate.logOutProcessCall(languageTag);
}
 
示例14
@Override
public Call changeLanguageProcessCall() {
    return changeLanguageProcessCaller.call();
}
 
示例15
@Override
public Call addLineItemProcessCall(final String languageTag) {
    return addLineItemProcessCaller.call(languageTag);
}
 
示例16
default Call changeAddressPageCall(final String addressIdentifier) {
    return changeAddressPageCall(locale().toLanguageTag(), addressIdentifier);
}
 
示例17
@Override
public Call removeLineItemProcessCall(final String languageTag) {
    return removeLineItemProcessCaller.call(languageTag);
}
 
示例18
default Call requestRecoveryEmailProcessCall() {
    return requestRecoveryEmailProcessCall(locale().toLanguageTag());
}
 
示例19
@Override
public Call removeDiscountCodeProcessCall(final String languageTag) {
    return removeDiscountCodeProcessCaller.call(languageTag);
}
 
示例20
FakeRequest jsonRequest(Call call, JsonNode body) {
    return fakeRequest(call).withJsonBody(body).withHeader(ACCEPT, Http.MimeTypes.JSON);
}
 
示例21
default Call myOrderListPageCall() {
    return myOrderListPageCall(locale().toLanguageTag());
}
 
示例22
@Override
public Call removeLineItemProcessCall(final String languageTag) {
    return delegate.removeLineItemProcessCall(languageTag);
}
 
示例23
@Override
public Call changePasswordProcessCall(final String languageTag) {
    return changePasswordProcessCaller.call(languageTag);
}
 
示例24
@Override
public Call checkoutShippingPageCall(final String languageTag) {
    return checkoutShippingPageCaller.call(languageTag);
}
 
示例25
@Override
public Call checkoutShippingProcessCall(final String languageTag) {
    return checkoutShippingProcessCaller.call(languageTag);
}
 
示例26
/**
 * {@inheritDoc}
 * It uses as product identifier the product slug for the current locale and as variant identifier the SKU.
 */
@Override
public Optional<Call> productDetailPageCall(final ProductProjection product, final ProductVariant productVariant) {
    return product.getSlug().find(locale())
            .map(slug -> productDetailPageCall(slug, productVariant.getSku()));
}
 
示例27
@Override
public Call changeAddressPageCall(final String languageTag, final String addressIdentifier) {
    return delegate.changeAddressPageCall(languageTag, addressIdentifier);
}
 
示例28
@Override
public Call changeAddressPageCall(final String languageTag, final String addressIdentifier) {
    return changeAddressPageCaller.call(languageTag, addressIdentifier);
}
 
示例29
@Override
public Call checkoutConfirmationProcessCall(final String languageTag) {
    return checkoutConfirmationProcessCaller.call(languageTag);
}
 
示例30
@Override
public Call checkoutThankYouPageCall(final String languageTag) {
    return checkoutThankYouPageCaller.call(languageTag);
}