package dp.kotul.solrapiapplication.util

import feign.Request
import feign.RequestTemplate
import feign.Response
import org.springframework.http.HttpStatus
import java.nio.charset.StandardCharsets

fun buildSolrResponse(responseBody: String, responseStatus: HttpStatus): Response {
    return Response.builder()
            .request(Request.create(
                    Request.HttpMethod.POST,
                    "localhost",
                    emptyMap<String, Collection<String>>(),
                    Request.Body.create("", StandardCharsets.UTF_8),
                    RequestTemplate()))
            .body(responseBody, StandardCharsets.UTF_8)
            .status(responseStatus.value())
            .build()
}
