Tenant { public final TenantTracingConfig getTracing() { return tracing; }  @JsonIgnore final boolean isValid(); @JsonIgnore final Tenant setEnabled(final boolean enabled); @JsonIgnore final boolean isEnabled(); final Tenant setExtensions(final Map<String, Object> extensions); final Tenant putExtension(final String key, final Object value); final Map<String, Object> getExtensions(); final Tenant setDefaults(final Map<String, Object> defaults); final Map<String, Object> getDefaults(); final Tenant setAdapters(final List<Adapter> adapters); final List<Adapter> getAdapters(); final Tenant addAdapterConfig(final Adapter configuration); final Integer getMinimumMessageSize(); final Tenant setMinimumMessageSize(final Integer minimumMessageSize); final ResourceLimits getResourceLimits(); final Tenant setResourceLimits(final ResourceLimits resourceLimits); final TenantTracingConfig getTracing(); final Tenant setTracing(final TenantTracingConfig tracing); List<TrustedCertificateAuthority> getTrustedCertificateAuthorities(); Tenant setTrustedCertificateAuthorities(final List<TrustedCertificateAuthority> trustedCertificateAuthorities); @JsonIgnore Set<X500Principal> getTrustedCertificateAuthoritySubjectDNs(); boolean hasTrustedCertificateAuthoritySubjectDN(final X500Principal subjectDn);  }
@Test public void testDecodeTraceSampling() { final JsonObject tracingConfigJson = new JsonObject() .put(RegistryManagementConstants.FIELD_TRACING_SAMPLING_MODE, TracingSamplingMode.ALL.getFieldValue()) .put(RegistryManagementConstants.FIELD_TRACING_SAMPLING_MODE_PER_AUTH_ID, new JsonObject() .put("authId1", TracingSamplingMode.ALL.getFieldValue()) .put("authId2", TracingSamplingMode.DEFAULT.getFieldValue())); final JsonObject tenantJson = new JsonObject(); tenantJson.put(RegistryManagementConstants.FIELD_TRACING, tracingConfigJson); final var tenant = tenantJson.mapTo(Tenant.class); assertNotNull(tenant); final TenantTracingConfig tracingConfig = tenant.getTracing(); assertNotNull(tracingConfig); assertEquals(TracingSamplingMode.ALL, tracingConfig.getSamplingMode()); assertEquals(TracingSamplingMode.ALL, tracingConfig.getSamplingModePerAuthId().get("authId1")); assertEquals(TracingSamplingMode.DEFAULT, tracingConfig.getSamplingModePerAuthId().get("authId2")); }