001/*002 * Copyright 2002-2018 the original author or authors.003 *004 * Licensed under the Apache License, Version 2.0 (the "License");005 * you may not use this file except in compliance with the License.006 * You may obtain a copy of the License at007 *008 * https://www.apache.org/licenses/LICENSE-2.0009 *010 * Unless required by applicable law or agreed to in writing, software011 * distributed under the License is distributed on an "AS IS" BASIS,012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.013 * See the License for the specific language governing permissions and014 * limitations under the License.015 */016017package org.springframework.mock.web;018019import javax.servlet.SessionCookieConfig;020021import org.springframework.lang.Nullable;022023/**024 * Mock implementation of the {@link javax.servlet.SessionCookieConfig} interface.025 *026 * @author Juergen Hoeller027 * @since 4.0028 * @see javax.servlet.ServletContext#getSessionCookieConfig()029 */030public class MockSessionCookieConfig implements SessionCookieConfig {031032 @Nullable033 private String name;034035 @Nullable036 private String domain;037038 @Nullable039 private String path;040041 @Nullable042 private String comment;043044 private boolean httpOnly;045046 private boolean secure;047048 private int maxAge = -1;049050051 @Override052 public void setName(@Nullable String name) {053 this.name = name;054 }055056 @Override057 @Nullable058 public String getName() {059 return this.name;060 }061062 @Override063 public void setDomain(@Nullable String domain) {064 this.domain = domain;065 }066067 @Override068 @Nullable069 public String getDomain() {070 return this.domain;071 }072073 @Override074 public void setPath(@Nullable String path) {075 this.path = path;076 }077078 @Override079 @Nullable080 public String getPath() {081 return this.path;082 }083084 @Override085 public void setComment(@Nullable String comment) {086 this.comment = comment;087 }088