package com.fasterxml.jackson.databind.deser;

import com.fasterxml.jackson.databind.*;

public class DeserializerFactoryTest extends BaseMapTest
{
    private final ObjectMapper MAPPER = sharedMapper();

    static class POJO2539 { }

    // [databind#2539]: check existence of deserializer for type
    public void testJDKDeserializerExistence() throws Exception
    {
        DeserializationContext ctxt = MAPPER.getDeserializationContext();
        DeserializerFactory factory = ctxt.getFactory();
        DeserializationConfig config = MAPPER.getDeserializationConfig();

        // First verify some basic types
        assertTrue(factory.hasExplicitDeserializerFor(config, String.class));
        assertTrue(factory.hasExplicitDeserializerFor(config, java.math.BigDecimal.class));
        assertTrue(factory.hasExplicitDeserializerFor(config, java.net.URL.class));
        assertTrue(factory.hasExplicitDeserializerFor(config, java.util.UUID.class));

        // and also negative testing
        assertFalse(factory.hasExplicitDeserializerFor(config, Object.class));
    }
}

@@ -364,24 +364,25 @@
 n%0A    %7B%0A
+%0A
         
 Deserial
@@ -377,364 +377,444 @@
     
-DeserializationContext ctxt = MAPPER.getDeserializationContext();%0A        DeserializerFactory factory = ctxt.getFactory();%0A        DeserializationConfig config = MAPPER.getDeserializationConfig();%0A%0A        // First verify some basic types%0A        assertTrue(factory.hasExplicitDeserializerFor(config, String.class));%0A        assertTrue(factory.hasE
+// First verify some basic types%0A        _verifyIsFound(String.class);%0A        _verifyIsFound(java.math.BigDecimal.class);%0A        _verifyIsFound(java.net.URL.class);%0A        _verifyIsFound(java.util.UUID.class);%0A%0A        // and also negative testing%0A        _verifyNotFound(Object.class);%0A    %7D%0A%0A    private void _verifyIsFound(Class%3C?%3E rawType) %7B%0A        if (!_verifyDeserExistence(rawType)) %7B%0A            fail(%22Should have e
 xplicit
-D
+ d
 eser
@@ -824,89 +824,195 @@
 izer
-For(config, java.math.BigDecimal.class));%0A        assertTrue(factory.hasE
+ for %22+rawType.getName());%0A        %7D%0A    %7D%0A%0A    private void _verifyNotFound(Class%3C?%3E rawType) %7B%0A        if (_verifyDeserExistence(rawType)) %7B%0A            fail(%22Should NOT have e
 xplicit
-D
+ d
 eser
@@ -1022,41 +1022,113 @@
 izer
-For(config, java.net.URL.class));
+ for %22+rawType.getName());%0A        %7D%0A    %7D%0A%0A    private boolean _verifyDeserExistence(Class%3C?%3E rawType) %7B
 %0A   
@@ -1136,95 +1136,139 @@
     
-assertTrue(factory.hasExplicitDeserializerFor(config, java.util.UUID.class)
+DeserializationContext ctxt = MAPPER.getDeserializationContext();%0A        DeserializerFactory factory = ctxt.getFactory(
 );%0A
-%0A
         
 // a
@@ -1267,57 +1267,90 @@
     
-// and also negative testing%0A        assertFalse(
+DeserializationConfig config = MAPPER.getDeserializationConfig();%0A%0A        return 
 fact
@@ -1388,29 +1388,23 @@
 config, 
-Object.class)
+rawType
 );%0A    %7D

test refactor