RpIdProviderImpl implements RpIdProvider { @Override public String provide(HttpServletRequest request) { Origin origin = ServletUtil.getOrigin(request); return origin.getHost(); }  @Override String provide(HttpServletRequest request);  }
@Test public void getEffectiveRpId() { RpIdProviderImpl rpIdProvider = new RpIdProviderImpl(); MockHttpServletRequest httpServletRequest = new MockHttpServletRequest(); httpServletRequest.setScheme("https"); httpServletRequest.setServerName("example.com"); httpServletRequest.setServerPort(8080); assertThat(rpIdProvider.provide(httpServletRequest)).isEqualTo("example.com"); }