### Question:
IpFailedLoginOverThresholdFilter extends MetadataFilter { @Override protected void apply(final HttpServletRequest request) { final String ip = request.getRemoteAddr(); final boolean isIpOverThreshold = ipOverLoginThresholdRegistry.contains(ip); request.setAttribute(RequestMetadata.IP_FAILED_LOGIN_OVER_THRESHOLD, isIpOverThreshold); } IpFailedLoginOverThresholdFilter(final IpOverLoginThresholdRegistry ipOverLoginThresholdRegistry);   }### Answer:
@Test void shouldMarkRequestBasedOnIp() { given(IPOverLoginThresholdRegistry.contains("1.2.3.4")).willReturn(true); final MockHttpServletRequest request = new MockHttpServletRequest(); request.setMethod("POST"); request.setServletPath("/login"); request.setRemoteAddr("1.2.3.4"); filter.apply(request); assertThat(request.getAttribute(RequestMetadata.IP_FAILED_LOGIN_OVER_THRESHOLD)).isEqualTo(TRUE); }