package samplest.core;
import com.github.kevinsawicki.http.HttpRequest;
import org.junit.After;
import org.junit.ClassRule;
import org.junit.Test;
import restx.factory.Factory;
import restx.tests.RestxServerRule;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Date: 13/12/13
* Time: 23:09
*/
public class RouteFilterTest {
@ClassRule
public static RestxServerRule server = new RestxServerRule();
@After
public void teardown() {
Factory.LocalMachines.threadLocal().clear();
}
@Test
public void should_apply_route_filter() throws Exception {
HttpRequest httpRequest = server.client().authenticatedAs("admin").GET(
"/api/route/filter");
assertThat(httpRequest.code()).isEqualTo(200);
assertThat(httpRequest.body().trim()).isEqualTo(">>route filter<<");
}
}