### Question:
ResourceConverterImpl implements ResourceConverter<ResourceType, ClientType> { protected List<Exception> validateResource(ResourceType resource, boolean skipRepoFieldsValidation, Map<String, String[]> additionalParameters) { ResourceValidator<ResourceType> validator = genericTypeProcessorRegistry .getTypeProcessor(resource.getResourceType(), ResourceValidator.class, false); List<Exception> result; if(validator != null){ } return (validator != null ? validator : defaultValidator).validate(resource, skipRepoFieldsValidation, additionalParameters); } ResourceConverterImpl(); String getServerResourceType(); @Override ResourceType toServer(ClientType clientObject, ToServerConversionOptions options); @Override ResourceType toServer(ClientType clientObject, ResourceType resultToUpdate, ToServerConversionOptions options); @Override ClientType toClient(ResourceType serverObject, ToClientConversionOptions options); @SuppressWarnings("unchecked") Class<ClientType> getClientTypeClass(); String getClientResourceType();  }### Answer:
@Test(expectedExceptions = JSValidationException.class) public void validateResource() { final Resource resource = mock(Resource.class); final String testResourceType = "testResourceType"; when(resource.getResourceType()).thenReturn(testResourceType); final ResourceValidator validator = mock(ResourceValidator.class); final HashMap<String, String[]> additionalParameters = new HashMap<String, String[]>(); doThrow(JSValidationException.class).when(validator).validate(resource, false, additionalParameters); when(genericTypeProcessorRegistry.getTypeProcessor(testResourceType, ResourceValidator.class, false)).thenReturn(validator); doCallRealMethod().when(converter).validateResource(resource, false, additionalParameters); converter.validateResource(resource, false, additionalParameters); }