1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juneau.http.response;
18
19 import static org.apache.juneau.http.HttpResponses.*;
20
21 import org.apache.juneau.*;
22 import org.apache.juneau.rest.annotation.*;
23 import org.apache.juneau.rest.mock.*;
24 import org.junit.jupiter.api.*;
25
26 class NonAuthoritativeInformation_Test extends TestBase {
27
28 @Rest
29 public static class A {
30 @RestGet public NonAuthoritiveInformation a1() { return NON_AUTHORATIVE_INFORMATION; }
31 @RestGet public NonAuthoritiveInformation a2() { return nonAuthoritiveInformation().setContent("foo"); }
32 @RestGet public NonAuthoritiveInformation a3() { return nonAuthoritiveInformation().setHeader2("Foo","bar"); }
33 }
34
35 @Test void a01_basic() throws Exception {
36 var client = MockRestClient.createLax(A.class).build();
37
38 client.get("/a1")
39 .run()
40 .assertStatus(203)
41 .assertContent("Non-Authoritative Information");
42 client.get("/a2")
43 .run()
44 .assertStatus(203)
45 .assertContent("foo");
46 client.get("/a3")
47 .run()
48 .assertStatus(203)
49 .assertHeader("Foo").is("bar");
50 }
51 }