summaryrefslogtreecommitdiffstats
path: root/simple/simple-http/src/test/java/org/simpleframework/http/core/MockProxyRequest.java
blob: a7f12b64d04a48d8b5dbf57895a696ff91eea4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package org.simpleframework.http.core;

import java.util.List;

import org.simpleframework.http.ContentType;
import org.simpleframework.http.Cookie;
import org.simpleframework.http.Path;
import org.simpleframework.http.Query;
import org.simpleframework.http.RequestHeader;

public class MockProxyRequest extends MockRequest {
   
   private RequestHeader header;
   
   public MockProxyRequest(RequestHeader header) {
      this.header = header;
   }
   
   public long getContentLength() {
      return header.getContentLength();
   }

   public ContentType getContentType() {
      return header.getContentType();
   }

   public String getValue(String name) {
      return header.getValue(name);
   }

   public List<String> getValues(String name) {
      return header.getValues(name);
   }

   public int getMajor() {      
      return header.getMajor();
   }

   public String getMethod() {
      return header.getMethod();
   }

   public int getMinor() {
      return header.getMajor();
   }

   public Path getPath() {
      return header.getPath();
   }

   public Query getQuery() {     
      return header.getQuery();
   }

   public String getTarget() {     
      return header.getTarget();
   }

   
   public String getParameter(String name) {
      return header.getQuery().get(name);
   }
   
   public Cookie getCookie(String name) {
      return header.getCookie(name);
   }   
}