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

com.github.tomakehurst.wiremock.admin.RemoveStubMappingsByMetadataTask Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
package com.github.tomakehurst.wiremock.admin;

import com.github.tomakehurst.wiremock.admin.model.PathParams;
import com.github.tomakehurst.wiremock.common.Json;
import com.github.tomakehurst.wiremock.core.Admin;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
import com.github.tomakehurst.wiremock.matching.StringValuePattern;

public class RemoveStubMappingsByMetadataTask implements AdminTask {

    @Override
    public ResponseDefinition execute(Admin admin, Request request, PathParams pathParams) {
        StringValuePattern pattern = Json.read(request.getBodyAsString(), StringValuePattern.class);
        admin.removeStubsByMetadata(pattern);
        return ResponseDefinition.okEmptyJson();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy