io.github.azagniotov.stubby4j.handlers.strategy.admin.NullHandlingStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stubby4j Show documentation
Show all versions of stubby4j Show documentation
A highly flexible and configurable tool for testing interactions of service-oriented (SoA) or/and micro-services architectures (REST, SOAP, WSDL etc.) over HTTP(s) protocol. It is an HTTP server for stubbing external systems in both Docker and non-containerized environments for integration, contract & behavior testing.
package io.github.azagniotov.stubby4j.handlers.strategy.admin;
import io.github.azagniotov.stubby4j.stubs.StubRepository;
import org.eclipse.jetty.http.HttpStatus;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class NullHandlingStrategy implements AdminResponseHandlingStrategy {
@Override
public void handle(final HttpServletRequest request, final HttpServletResponse response, final StubRepository stubRepository) throws IOException {
response.setStatus(HttpStatus.NOT_IMPLEMENTED_501);
response.getWriter().println(String.format("Method %s is not implemented on URI %s", request.getMethod(), request.getRequestURI()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy