### Question:
LookupResourceConverter extends ResourceConverterImpl<ResourceLookup, ClientResourceLookup> { protected String toClientResourceType(String serverResourceType){ String clientType; try { clientType = resourceConverterProvider.getToClientConverter(serverResourceType).getClientResourceType(); } catch (IllegalParameterValueException e){ clientType = "unknown"; } return clientType; }  @Override ResourceDetails toServer(ClientResourceLookup clientObject, ResourceLookup resultToUpdate, ToServerConversionOptions options); @Override ResourceLookup toServer(ClientResourceLookup clientObject, ToServerConversionOptions options);  }### Answer:
@Test public void toClientResourceType() { final String serverResourceType = "serverResourceType"; final String clientResourceType = "clientResourceType"; final ToClientConverter<Resource, ClientResource, ToClientConversionOptions> toClientConverter = new ToClientConverter<Resource, ClientResource, ToClientConversionOptions>() { @Override public ClientResource toClient(Resource serverObject, ToClientConversionOptions options) { return null; } @Override public String getClientResourceType() { return clientResourceType; } }; reset(resourceConverterProvider); doReturn(toClientConverter).when(resourceConverterProvider).getToClientConverter(serverResourceType); assertEquals(converter.toClientResourceType(serverResourceType), clientResourceType); }
@Test public void toClientResourceType_unknownType() { final String serverResourceType = "serverResourceType"; final String clientResourceType = "unknown"; reset(resourceConverterProvider); when(resourceConverterProvider.getToClientConverter(serverResourceType)).thenThrow(IllegalParameterValueException.class); assertEquals(converter.toClientResourceType(serverResourceType), clientResourceType); }