package guru.nidi.ramltester.uc.servlet;

import guru.nidi.ramltester.RamlDefinition;
import guru.nidi.ramltester.RamlViolations;
import guru.nidi.ramltester.servlet.RamlTesters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import java.io.IOException;

/**
 *
 */
public class RamlFilter implements Filter {
    private final Logger log = LoggerFactory.getLogger(getClass());

    private RamlDefinition api;

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        api = RamlDefinition.fromClasspath(getClass(), "api.yaml");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        final RamlViolations violations = RamlTesters.executeFilterChain(api, request, response, chain);
        log.info("Violations: " + violations);
    }

    @Override
    public void destroy() {

    }
}

@@ -155,27 +155,16 @@
 ter.
-servlet.RamlTesters
+TestRaml
 ;%0Aim
@@ -531,30 +531,41 @@
   api = 
-RamlDefinition
+TestRaml.load(%22api.yaml%22)
 .fromCla
@@ -585,20 +585,8 @@
 ss()
-, %22api.yaml%22
 );%0A 
@@ -784,44 +784,24 @@
 s = 
-RamlTesters.executeFilterChain(api, 
+api.testAgainst(
 requ

update dependency