The public display configuration ({@code publicConfig}) is preserved, so the task can be
- * published again without re-entering it. Requires write permission to the task only (unlike
- * {@link #publish()}, it does not require permission to the task's Actor). Unpublishing a task
- * that is not published does nothing.
+ * published again without re-entering it. Like {@link #publish()}, requires write permission to
+ * both the task and its Actor. Unpublishing a task that is not published does nothing.
*/
public CompletableFuture Not part of the documented {@code Task} schema in the OpenAPI spec, but the API returns it in
- * practice (mirroring the reference JS client's {@code TaskPublicConfig}).
+ * {@link #getCategorization()} is not part of the documented {@code TaskPublicConfig} schema in
+ * the OpenAPI spec, but is kept here for parity with the reference JS client, which also exposes
+ * it. Every other field below is part of the documented schema.
*/
public final class TaskPublicConfig extends ApifyResource {
private Instant publishedAt;
@@ -39,16 +40,18 @@ public String getSeoDescription() {
return seoDescription;
}
- /** The category the task is listed under on its public landing page. */
+ /**
+ * The category the task is listed under on its public landing page. Not part of the documented
+ * schema; see the class-level note.
+ */
public String getCategorization() {
return categorization;
}
/** Which input schema fields are shown on the public landing page. */
public List Not exercised here: {@code HttpClientCore.compress}'s per-call fallback from a
* failing brotli encode to gzip (as opposed to the upfront {@code BROTLI_AVAILABLE} check,
- * which the brotli-path tests below do exercise). Accepted gap, not an oversight: brotli4j's
- * in-memory {@code Encoder.compress} has no documented, portable way to be made to throw once the
- * native codec has loaded for a given platform, so a test forcing that failure would need to fake
- * the codec behind a seam that does not otherwise exist in this client - not worth adding for a
- * defense-in-depth branch whose only effect, if it were ever reached, is choosing gzip over brotli
- * (both already-tested, already-correct codings).
+ * which the brotli-path tests below do exercise). Accepted gap: brotli4j's {@code Encoder.compress}
+ * has no portable way to be forced to throw once the native codec has loaded, and the fallback only
+ * chooses between two codings already covered above.
*/
class CompressionTest {
diff --git a/src/test/java/com/apify/client/integration/TaskIntegrationTest.java b/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
index 62f702a..4976c4f 100644
--- a/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
+++ b/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
@@ -104,9 +104,11 @@ void taskPublishUnpublish() {
try {
TaskClient tc = client.task(task.getId());
- // unpublish() only requires write permission to the task itself, not its Actor, so it
- // succeeds here even though the task's Actor (apify/hello-world) is unowned by this test
- // account. Reuses the update() PUT and leaves isPublic not-true.
+ // The freshly created task is already unpublished, so this unpublish() call is a no-op per
+ // the spec ("sending the value the task already has does nothing") - it succeeds even
+ // though the task's Actor (apify/hello-world) is unowned by this test account, without that
+ // being evidence that unpublish() needs less permission than publish(): both require write
+ // permission to the task's Actor. Reuses the update() PUT and leaves isPublic not-true.
Task unpublished = tc.unpublish().join();
assertFalse(Boolean.TRUE.equals(unpublished.getIsPublic()));