HttpMethod { public static HttpMethod valueOf(String verb){ return REGISTRY.computeIfAbsent(String.valueOf(verb).toUpperCase(), HttpMethod::new); } private  HttpMethod(String name); static HttpMethod valueOf(String verb); Set<HttpMethod> all(); String name(); @Override String toString(); static final HttpMethod GET; static final HttpMethod POST; static final HttpMethod PUT; static final HttpMethod DELETE; static final HttpMethod PATCH; static final HttpMethod HEAD; static final HttpMethod OPTIONS; static final HttpMethod TRACE; }
@Test public void equalsTest() { assertEquals(HttpMethod.valueOf("GET"), HttpMethod.valueOf("GET")); assertEquals(HttpMethod.GET, HttpMethod.GET); assertNotEquals(HttpMethod.valueOf("GET"), HttpMethod.valueOf("PUT")); assertNotEquals(HttpMethod.GET, HttpMethod.PUT); }
@Test public void notCaseSensative() { assertEquals(HttpMethod.valueOf("GET"), HttpMethod.valueOf("get")); }