All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.azagniotov.stubby4j.handlers.strategy.admin.NullHandlingStrategy Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 7.6.1
Show newest version
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