com.github.httpmock.api.Stubbing Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mock-http-server-junit Show documentation
Show all versions of mock-http-server-junit Show documentation
Mock HTTP Server - JUnit Rules
The newest version!
package com.github.httpmock.api;
import com.github.httpmock.builder.ResponseBuilder;
import com.github.httpmock.dto.ConfigurationDto;
import com.github.httpmock.dto.RequestDto;
import com.github.httpmock.dto.ResponseDto;
public class Stubbing {
private MockService mockService;
private RequestDto request;
public Stubbing(MockService mockService, RequestDto request) {
this.mockService = mockService;
this.request = request;
}
public void thenRespond(ResponseDto response) {
mockService.configure(new ConfigurationDto(request, response));
}
public void thenRespond(ResponseBuilder responseBuilder) {
thenRespond(responseBuilder.build());
}
public void then(ResponseDto response) {
thenRespond(response);
}
public void then(ResponseBuilder responseBuilder) {
thenRespond(responseBuilder.build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy