001package org.w3.ldp.testsuite.matcher;
002
003import org.apache.http.HttpStatus;
004import org.hamcrest.Description;
005import org.hamcrest.Factory;
006import org.hamcrest.Matcher;
007import org.hamcrest.TypeSafeMatcher;
008
009public class HttpStatusNotFoundOrGoneMatcher extends TypeSafeMatcher<Integer> {
010
011        @Override
012        public void describeTo(Description d) {
013                d.appendText("404 Not Found or 410 Gone");
014        }
015
016        @Override
017        protected boolean matchesSafely(Integer status) {
018                return status == HttpStatus.SC_NOT_FOUND || status == HttpStatus.SC_GONE;
019        }
020
021        @Factory
022        public static Matcher<Integer> isNotFoundOrGone() {
023                return new HttpStatusNotFoundOrGoneMatcher();
024        }
025}