001package org.w3.ldp.testsuite.matcher;
002
003import org.hamcrest.Description;
004import org.hamcrest.Factory;
005import org.hamcrest.Matcher;
006import org.hamcrest.TypeSafeMatcher;
007
008public class HttpStatusSuccessMatcher extends TypeSafeMatcher<Integer> {
009
010        @Override
011        public void describeTo(Description d) {
012                d.appendText("between 200 and 209");
013        }
014
015        @Override
016        protected boolean matchesSafely(Integer status) {
017                return status >= 200 && status <= 209;
018        }
019
020        @Factory
021        public static Matcher<Integer> isSuccessful() {
022                return new HttpStatusSuccessMatcher();
023        }
024
025}