@Test public void test_should_perform_update_eligibility_validation() { final ServiceRequest serviceRequest = createServiceRequest(true); validator.validate(serviceRequest); verify(eligibilityService).validate(eq("crn"), eq("tenant"), any(AuthenticatedUser.class)); }
@Override public void validate(ServiceRequest serviceRequest) { final AuthenticatedUser user = serviceRequest.getAuthenticatedUser(); updateRequestEligibilityService.validate(serviceRequest.getCrn(), serviceRequest.getTenantId(), user); }
UpdateRequestEligibilityValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { final AuthenticatedUser user = serviceRequest.getAuthenticatedUser(); updateRequestEligibilityService.validate(serviceRequest.getCrn(), serviceRequest.getTenantId(), user); } }
UpdateRequestEligibilityValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { final AuthenticatedUser user = serviceRequest.getAuthenticatedUser(); updateRequestEligibilityService.validate(serviceRequest.getCrn(), serviceRequest.getTenantId(), user); } UpdateRequestEligibilityValidator(UpdateServiceRequestEligibilityService updateRequestEligibilityService); }
UpdateRequestEligibilityValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { final AuthenticatedUser user = serviceRequest.getAuthenticatedUser(); updateRequestEligibilityService.validate(serviceRequest.getCrn(), serviceRequest.getTenantId(), user); } UpdateRequestEligibilityValidator(UpdateServiceRequestEligibilityService updateRequestEligibilityService); @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest); }
UpdateRequestEligibilityValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { final AuthenticatedUser user = serviceRequest.getAuthenticatedUser(); updateRequestEligibilityService.validate(serviceRequest.getCrn(), serviceRequest.getTenantId(), user); } UpdateRequestEligibilityValidator(UpdateServiceRequestEligibilityService updateRequestEligibilityService); @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest);  }