Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/

package com.marklogic.client.test;
Expand Down Expand Up @@ -1441,6 +1441,7 @@ public void testXdmpFormatNumber8Exec() {
executeTester("testXdmpFormatNumber8", p.xdmp.formatNumber(p.col("1"), p.col("2"), p.col("3"), p.col("4"), p.col("5"), p.col("6"), p.col("7"), p.col("8")), false, null, null, null, "NINE", new ServerExpression[]{ p.xs.doubleVal(9), p.xs.string("W"), p.xs.string("en"), p.xs.string(""), p.xs.string(""), p.xs.string(""), p.xs.string(","), p.xs.integer(3) });
}

@ExtendWith(RequiresML11OrLower.class)
@Test
public void testXdmpGetCurrentUser0Exec() {
executeTester("testXdmpGetCurrentUser0", p.xdmp.getCurrentUser(), true, null, null, null, "admin", new ServerExpression[]{ });
Expand Down Expand Up @@ -1677,11 +1678,13 @@ public void testXdmpUnquote1Exec() {
executeTester("testXdmpUnquote1", p.xdmp.unquote(p.col("1")), false, null, "array", Format.JSON, "[123]", new ServerExpression[]{p.xs.string("[123]")});
}

@ExtendWith(RequiresML11OrLower.class)
@Test
public void testXdmpUriContentType1Exec() {
executeTester("testXdmpUriContentType1", p.xdmp.uriContentType(p.col("1")), false, null, null, null, "application/json", new ServerExpression[]{ p.xs.string("a.json") });
}

@ExtendWith(RequiresML11OrLower.class)
@Test
public void testXdmpUriFormat1Exec() {
executeTester("testXdmpUriFormat1", p.xdmp.uriFormat(p.col("1")), false, null, null, null, "json", new ServerExpression[]{ p.xs.string("a.json") });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/
package com.marklogic.client.test.rows;

Expand Down Expand Up @@ -37,13 +37,15 @@ public abstract class AbstractOpticUpdateTest extends AbstractClientTest {

private final static String XML_PREAMBLE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

protected static final String TEST_USER = "writer-no-default-permissions";

protected RowManager rowManager;
protected PlanBuilder op;
protected ObjectMapper mapper = new ObjectMapper();

@BeforeEach
public void setup() {
Common.client = Common.newClientBuilder().withUsername("writer-no-default-permissions").build();
Common.client = Common.newClientBuilder().withUsername(TEST_USER).build();
rowManager = Common.client.newRowManager().withUpdate(true);
op = rowManager.newPlanBuilder();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/
package com.marklogic.client.test.rows;

Expand Down Expand Up @@ -153,20 +153,20 @@ public void wrapContentInEnvelope() {
.bind(op.as(
op.col("doc"),
op.jsonObject(
op.prop("header", op.jsonObject(op.prop("user", op.xdmp.getCurrentUser()))),
op.prop("header", op.jsonObject(op.prop("user", op.xs.string(op.param("currentUser"))))),
op.prop("body", op.col("doc"))
)
));

rowManager.execute(plan.write());
rowManager.execute(plan.write().bindParam("currentUser", TEST_USER));

verifyJsonDoc("/acme/1.json", doc -> {
assertEquals("writer-no-default-permissions", doc.get("header").get("user").asText());
assertEquals(TEST_USER, doc.get("header").get("user").asText());
assertEquals(1, doc.get("body").get("value").asInt());
});

verifyJsonDoc("/acme/2.json", doc -> {
assertEquals("writer-no-default-permissions", doc.get("header").get("user").asText());
assertEquals(TEST_USER, doc.get("header").get("user").asText());
assertEquals(2, doc.get("body").get("value").asInt());
});
}
Expand Down
Loading