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;

Expand Down Expand Up @@ -55,4 +55,9 @@ public int getMaxAge() {
public String getValue() {
return value;
}

@Override
public String toString() {
return name + "=" + value;
}
Comment on lines +59 to +62
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/
package com.marklogic.client.test;

import com.marklogic.client.ClientCookie;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class ClientCookieTest {

@Test
void toStringReturnsNameEqualsValue() {
ClientCookie cookie = new ClientCookie("HostId", "abc123", Long.MAX_VALUE, "localhost", "/", false);
assertEquals("HostId=abc123", cookie.toString(),
"ClientCookie.toString() must return name=value for correct Cookie header formatting");
}

@Test
void toStringWithEmptyValue() {
ClientCookie cookie = new ClientCookie("SessionId", "", Long.MAX_VALUE, "localhost", "/", false);
assertEquals("SessionId=", cookie.toString());
}
}
Loading