From 4baece95779dd46a3a59d59d1b7aa5958cf6117d Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 05 Nov 2015 12:25:29 +0000
Subject: [PATCH] OPENDJ-1802 Make ByteString methods more intentional
---
opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
index bc4424f..249475d 100644
--- a/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
@@ -117,7 +117,7 @@
entry.addControl(control);
}
entry.addAttribute(new LinkedAttribute("test", "value1"));
- entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOf("myValue")));
+ entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue")));
SearchResultEntry result = to(entry);
assertThat(result.getName().toString()).isEqualTo(entry.getName().toString());
@@ -135,7 +135,7 @@
new LinkedHashMapEntry(org.forgerock.opendj.ldap.DN
.valueOf("uid=scarter,ou=People,dc=example,dc=com"));
entry.addAttribute(new LinkedAttribute("test", "value1"));
- entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOf("myValue")));
+ entry.addAttribute(new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue")));
org.opends.server.types.Entry result = to(entry);
assertThat(result.getName().toString()).isEqualTo(entry.getName().toString());
@@ -255,7 +255,7 @@
assertThat(srvAttribute.getValues().get(0).toString()).isEqualTo("value1");
org.forgerock.opendj.ldap.Attribute attribute2 =
- new LinkedAttribute("Another", ByteString.valueOf("myValue"));
+ new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue"));
org.opends.server.types.RawAttribute srvAttribute2 = to(attribute2);
assertThat(srvAttribute2.getAttributeType()).isEqualTo("Another");
@@ -273,7 +273,7 @@
assertThat(srvAttribute.iterator().next().toString()).isEqualTo("value1");
org.forgerock.opendj.ldap.Attribute attribute2 =
- new LinkedAttribute("Another", ByteString.valueOf("myValue"));
+ new LinkedAttribute("Another", ByteString.valueOfUtf8("myValue"));
org.opends.server.types.Attribute srvAttribute2 = toAttribute(attribute2);
assertThat(srvAttribute2.getAttributeType().getNameOrOID()).isEqualTo("Another");
@@ -344,8 +344,8 @@
@Test
public final void testToRawModification() {
org.forgerock.opendj.ldap.Attribute attribute =
- new LinkedAttribute("test", ByteString.valueOf("value1"), ByteString
- .valueOf("value2"));
+ new LinkedAttribute("test", ByteString.valueOfUtf8("value1"), ByteString
+ .valueOfUtf8("value2"));
Modification mod = new Modification(ModificationType.ADD, attribute);
@@ -362,8 +362,8 @@
@Test
public final void testToModification() {
org.forgerock.opendj.ldap.Attribute attribute =
- new LinkedAttribute("test", ByteString.valueOf("value1"), ByteString
- .valueOf("value2"));
+ new LinkedAttribute("test", ByteString.valueOfUtf8("value1"), ByteString
+ .valueOfUtf8("value2"));
Modification mod = new Modification(ModificationType.ADD, attribute);
@@ -446,7 +446,7 @@
@Test
public static void testFromLDAPControl() {
org.opends.server.protocols.ldap.LDAPControl ldapControl =
- new LDAPControl("1.2.3.4", false, ByteString.valueOf("myData"));
+ new LDAPControl("1.2.3.4", false, ByteString.valueOfUtf8("myData"));
Control sdkControl = from(ldapControl);
Control expectedSdkControl = GenericControl.newControl("1.2.3.4", false, "myData");
@@ -476,7 +476,7 @@
@Test
public static void testFromControl() {
final org.opends.server.types.Control control =
- new LDAPControl("1.2.3.4", false, ByteString.valueOf("myData"));
+ new LDAPControl("1.2.3.4", false, ByteString.valueOfUtf8("myData"));
Control sdkControl = from(control);
Control expectedSdkControl = GenericControl.newControl("1.2.3.4", false, "myData");
@@ -513,7 +513,7 @@
final GenericBindRequest genericBindRequest = bindClient.nextBindRequest();
assertThat(getCredentials(genericBindRequest.getAuthenticationValue())).isEqualTo(
- ByteString.valueOf("\u0000u:user.0\u0000password"));
+ ByteString.valueOfUtf8("\u0000u:user.0\u0000password"));
}
/**
--
Gitblit v1.10.0