001/**
002 * Powerunit - A JDK1.8 test framework
003 * Copyright (C) 2014 Mathieu Boretti.
004 *
005 * This file is part of Powerunit
006 *
007 * Powerunit is free software: you can redistribute it and/or modify
008 * it under the terms of the GNU General Public License as published by
009 * the Free Software Foundation, either version 3 of the License, or
010 * (at your option) any later version.
011 *
012 * Powerunit is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015 * GNU General Public License for more details.
016 *
017 * You should have received a copy of the GNU General Public License
018 * along with Powerunit. If not, see <http://www.gnu.org/licenses/>.
019 */
020package ch.powerunit;
021
022import org.hamcrest.Matcher;
023
024/**
025 * DSL for assertion on exception result.
026 * <p>
027 * This interface is returned by the various methods
028 * {@link TestSuite#assertWhen(Statement) assertWhen} exposed by
029 * {@link TestSuite}.
030 *
031 * @author borettim
032 *
033 * @param <T>
034 *            The exception type
035 */
036public interface AssertThatException<T extends Throwable> {
037
038    /**
039     * Define the matcher on the exception and execute the matcher validation.
040     * 
041     * @param matching
042     *            the matcher.
043     */
044    void throwException(Matcher<T> matching);
045}