@Test(expected = TenantIdMandatoryException.class) public void test_should_throw_exception_when_tenant_id_is_not_present() { final ServiceRequest serviceRequest = createServiceRequest(null); final TenantIdMandatoryValidator validator = new TenantIdMandatoryValidator(); validator.validate(serviceRequest); }
@Override public void validate(ServiceRequest serviceRequest) { if (serviceRequest.isTenantIdAbsent()) { throw new TenantIdMandatoryException(); } }
TenantIdMandatoryValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { if (serviceRequest.isTenantIdAbsent()) { throw new TenantIdMandatoryException(); } } }
TenantIdMandatoryValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { if (serviceRequest.isTenantIdAbsent()) { throw new TenantIdMandatoryException(); } }  }
TenantIdMandatoryValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { if (serviceRequest.isTenantIdAbsent()) { throw new TenantIdMandatoryException(); } }  @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest); }
TenantIdMandatoryValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { if (serviceRequest.isTenantIdAbsent()) { throw new TenantIdMandatoryException(); } }  @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest);  }