All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mjeanroy.restassert.assertj.internal.Cookies Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2018 Mickael Jeanroy
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.github.mjeanroy.restassert.assertj.internal;

import org.assertj.core.api.AssertionInfo;

/**
 * Reusable assertions of http response.
 * This class is implemented as a singleton.
 * This class is thread safe.
 * This class is automatically generated during build.
 */
public class Cookies extends AbstractRestAssertions {

	/**
	 * Singleton instance.
	 */
	private static final Cookies INSTANCE = new Cookies();

	/**
	 * Returns the singleton instance of this class.
	 */
	public static Cookies instance() {
		return INSTANCE;
	}

	/**
	 * Original assertions object, retrieved from core module.
	 */
	private final com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions assertions = com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions.instance();

	// Private constructor to ensure class is a singleton
	private Cookies() {
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#hasDomain
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertHasDomain(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual, java.lang.String domain) {
		assertNotNull(info, actual);
		check(info, assertions.hasDomain(actual, domain));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#hasMaxAge
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertHasMaxAge(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual, long maxAge) {
		assertNotNull(info, actual);
		check(info, assertions.hasMaxAge(actual, maxAge));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#hasName
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertHasName(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual, java.lang.String name) {
		assertNotNull(info, actual);
		check(info, assertions.hasName(actual, name));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#hasPath
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertHasPath(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual, java.lang.String path) {
		assertNotNull(info, actual);
		check(info, assertions.hasPath(actual, path));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#hasValue
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertHasValue(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual, java.lang.String value) {
		assertNotNull(info, actual);
		check(info, assertions.hasValue(actual, value));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#isHttpOnly
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertIsHttpOnly(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual) {
		assertNotNull(info, actual);
		check(info, assertions.isHttpOnly(actual));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#isNotHttpOnly
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertIsNotHttpOnly(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual) {
		assertNotNull(info, actual);
		check(info, assertions.isNotHttpOnly(actual));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#isNotSecured
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertIsNotSecured(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual) {
		assertNotNull(info, actual);
		check(info, assertions.isNotSecured(actual));
	}

	/**
	 * @see com.github.mjeanroy.restassert.core.internal.assertions.CookieAssertions#isSecured
	 *
	 * @param info contains information about the assertion.
	 * @param actual actual object.
	 * @throws AssertionError
	 */
	public void assertIsSecured(AssertionInfo info, com.github.mjeanroy.restassert.core.internal.data.Cookie actual) {
		assertNotNull(info, actual);
		check(info, assertions.isSecured(actual));
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy