com.base.Http.Clients.TestHttpClient   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A send(Request,Response) 0 7 2
A TestHttpClient(TestHttpServer) 0 2 1
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