KubernetesDeserializer extends JsonDeserializer<KubernetesResource> { public static void registerProvider(KubernetesResourceMappingProvider provider) { mapping.registerProvider(provider); }  @Override KubernetesResource deserialize(JsonParser jp, DeserializationContext ctxt); static void registerCustomKind(String kind, Class<? extends KubernetesResource> clazz); static void registerCustomKind(String apiVersion, String kind, Class<? extends KubernetesResource> clazz); static void registerProvider(KubernetesResourceMappingProvider provider);  }
@Test public void shouldRegisterProvider() { String key = mapping.createKey("42", "Hitchhiker"); assertThat(mapping.getForKey(key), is(nullValue())); KubernetesResourceMappingProvider provider = createProvider( Pair.of(key, SmurfResource.class)); mapping.registerProvider(provider); Class<? extends KubernetesResource> clazz = mapping.getForKey(key); assertThat(clazz, equalTo(SmurfResource.class)); }