• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #431

18 Nov 2026 09:28PM UTC coverage: 71.813% (+0.01%) from 71.8%
#431

push

github

web-flow
Include inherited fields in service stub options toString (#3152)

* Include inherited fields in service stub options toString

WorkflowServiceStubsOptions.toString rendered only the five fields
declared on the subclass, silently dropping every field inherited from
ServiceStubsOptions. Target, TLS settings, timeouts, and headers were
absent from the output, which is exactly the connection information
wanted when diagnosing a client from logs.

OperatorServiceStubsOptions and CloudServiceStubsOptions had no
toString at all and fell back to Object.toString, logging as an
unreadable identity hash.

Extract the field rendering on ServiceStubsOptions into a
package-private toStringFields helper and have each subclass inline it
alongside its own fields. The helper is package-private because all
four classes live in io.temporal.serviceclient, so this adds no public
API surface.

Also include apiKeyProvided, which already participates in equals and
hashCode but was omitted from toString. The API key itself is held by a
metadata provider and is still never rendered.

Fixes #2148.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Render header names instead of header values in toString

Metadata.toString renders header values in the clear. The previous
commit propagated the inherited headers field into
WorkflowServiceStubsOptions, OperatorServiceStubsOptions, and
CloudServiceStubsOptions, which would have newly exposed any credential
supplied through setHeaders, such as a static Authorization header.

Render the header names only. This keeps the diagnostic signal that
matters when reading the output, whether a header is configured and
which ones, without printing what they contain.

Also add a regression test for the missing separator before
congestionInitialInterval in RpcRetryOptions.toString.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add changelog entry for service stub options toString

Co-Authored-By: Claude Opus 5.5 <noreply@anthro... (continued)

8779 of 14371 branches covered (61.09%)

Branch coverage included in aggregate %.

5 of 6 new or added lines in 4 files covered. (83.33%)

892 existing lines in 36 files now uncovered.

34625 of 46069 relevant lines covered (75.16%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/temporal-sdk/src/main/java/io/temporal/internal/statemachines/StateMachineCommandUtils.java
1
package io.temporal.internal.statemachines;
2

3
import io.temporal.api.command.v1.Command;
4
import io.temporal.api.command.v1.RecordMarkerCommandAttributes;
5
import io.temporal.api.enums.v1.CommandType;
6
import io.temporal.api.sdk.v1.EventGroupMarker;
7
import io.temporal.api.sdk.v1.UserMetadata;
8
import java.util.Collections;
9
import java.util.List;
10
import javax.annotation.Nullable;
11

UNCOV
12
class StateMachineCommandUtils {
×
13
  public static final Command RECORD_MARKER_FAKE_COMMAND =
1 ✔
14
      createRecordMarker(RecordMarkerCommandAttributes.getDefaultInstance(), null);
1 ✔
15

16
  public static Command createRecordMarker(
17
      RecordMarkerCommandAttributes attributes, @Nullable UserMetadata metadata) {
18
    return createRecordMarker(attributes, metadata, Collections.emptyList());
1 ✔
19
  }
20

21
  public static Command createRecordMarker(
22
      RecordMarkerCommandAttributes attributes,
23
      @Nullable UserMetadata metadata,
24
      List<EventGroupMarker> eventGroupMarkers) {
25
    Command.Builder command =
26
        Command.newBuilder()
1 ✔
27
            .setCommandType(CommandType.COMMAND_TYPE_RECORD_MARKER)
1 ✔
28
            .setRecordMarkerCommandAttributes(attributes)
1 ✔
29
            .addAllEventGroupMarkers(eventGroupMarkers);
1 ✔
30
    if (metadata != null) {
1 ✔
31
      command.setUserMetadata(metadata);
1 ✔
32
    }
33
    return command.build();
1 ✔
34
  }
35

36
  public static Command createFakeMarkerCommand(String markerName) {
37
    return createRecordMarker(
1 ✔
38
        RecordMarkerCommandAttributes.newBuilder().setMarkerName(markerName).build(), null);
1 ✔
39
  }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc