use of javax.ws.rs.core.Response.StatusType in project java-chassis by ServiceComb.
the class TestHttpStatusManager method test.
@Test
public void test() {
HttpStatusManager mgr = new HttpStatusManager();
StatusType st = mgr.getOrCreateByStatusCode(200);
Assert.assertEquals(200, st.getStatusCode());
st = mgr.getOrCreateByStatusCode(250);
Assert.assertEquals(250, st.getStatusCode());
try {
mgr.addStatusType(new HttpStatus(250, "250"));
throw new Error("not allowed");
} catch (Throwable e) {
Assert.assertEquals("repeated status code: 250", e.getMessage());
}
}
Aggregations