Skip to content

Commit c3c5e45

Browse files
committed
addressed copilot comments
1 parent 72c1fc8 commit c3c5e45

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ public PurgeResult purgeInstances(PurgeInstanceCriteria purgeInstanceCriteria) t
345345

346346
@Override
347347
public void rewindInstance(String instanceId, @Nullable String reason) {
348+
Helpers.throwIfArgumentNull(instanceId, "instanceId");
348349
RewindInstanceRequest.Builder rewindRequestBuilder = RewindInstanceRequest.newBuilder();
349350
rewindRequestBuilder.setInstanceId(instanceId);
350351
if (reason != null) {

endtoendtests/src/test/java/com/functions/EndToEndTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ public static void setup() {
3232
RestAssured.baseURI = "http://localhost";
3333
// Use port 8080 for Docker, 7071 for local func start
3434
String port = System.getenv("FUNCTIONS_PORT");
35-
RestAssured.port = port != null ? Integer.parseInt(port) : 8080;
35+
if (port != null) {
36+
try {
37+
RestAssured.port = Integer.parseInt(port);
38+
} catch (NumberFormatException e) {
39+
throw new IllegalArgumentException(
40+
"FUNCTIONS_PORT environment variable must be a valid integer, but was: '" + port + "'", e);
41+
}
42+
} else {
43+
RestAssured.port = 8080;
44+
}
3645
}
3746

3847
@Order(1)

0 commit comments

Comments
 (0)