send(Request,Response)   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
1
package com.base.Http.Clients;
2
3
import com.base.Exceptions.BaseHttpException;
4
import com.base.Http.Request.Request;
5
import com.base.Http.Response.Response;
6
import com.base.Http.Server.TestHttpServer;
7
8
public class TestHttpClient implements HttpClientInterface {
9
10
    private final TestHttpServer server;
11
12
    public TestHttpClient(TestHttpServer server) {
13
        this.server = server;
14
    }
15
16
    @Override
17
    public Response send(Request request, Response response) throws BaseHttpException {
18
        if (response == null) {
19
            response = new Response(request);
20
        }
21
22
        return this.server.handle(request, response);
23
    }
24
}
25