Tenant { public final Tenant setTracing(final TenantTracingConfig tracing) { this.tracing = tracing; return this; }  @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 testEncodeTraceSamplingModePerAuthId() { final var tenant = new Tenant(); final TenantTracingConfig tracingConfig = new TenantTracingConfig(); tracingConfig.setSamplingMode(TracingSamplingMode.ALL); tracingConfig.setSamplingModePerAuthId( Map.of("authId1", TracingSamplingMode.ALL, "authId2", TracingSamplingMode.DEFAULT)); tenant.setTracing(tracingConfig); final var json = JsonObject.mapFrom(tenant); assertNotNull(json); final JsonObject tracingConfigJson = json.getJsonObject(RegistryManagementConstants.FIELD_TRACING); assertNotNull(tracingConfigJson); assertEquals(TracingSamplingMode.ALL.getFieldValue(), tracingConfigJson.getString(RegistryManagementConstants.FIELD_TRACING_SAMPLING_MODE)); final JsonObject traceSamplingModePerAuthIdJson = tracingConfigJson.getJsonObject(RegistryManagementConstants.FIELD_TRACING_SAMPLING_MODE_PER_AUTH_ID); assertNotNull(traceSamplingModePerAuthIdJson); assertEquals(TracingSamplingMode.ALL.getFieldValue(), traceSamplingModePerAuthIdJson.getString("authId1")); assertEquals(TracingSamplingMode.DEFAULT.getFieldValue(), traceSamplingModePerAuthIdJson.getString("authId2")); }