Skip to content

Commit

Permalink
Improvements after review
Browse files Browse the repository at this point in the history
* Remove unused imports
* Remove temporary unittest
* Add missing javadoc

Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Nov 24, 2021
1 parent 8576dc1 commit 0479af1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public static String toUtf8String(@Nullable final ByteBuffer byteBuffer) {
* Creates a string from the ByteBuffer using the given charset.
*
* @param value the ByteBuffer to decode.
* @return the ByteBuffer or {@code null} if it was null.
* @param charset the charset to use for decoding.
* @return the string or {@code null} if {@code value} was null.
*/
@Nullable
public static String toString(final ByteBuffer value, final Charset charset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.eclipse.ditto.base.model.exceptions.DittoRuntimeException;
import org.eclipse.ditto.base.model.headers.DittoHeaderDefinition;
import org.eclipse.ditto.base.model.headers.DittoHeaders;
import org.eclipse.ditto.base.model.headers.contenttype.ContentType;
import org.eclipse.ditto.base.model.signals.Signal;
import org.eclipse.ditto.connectivity.api.ExternalMessage;
import org.eclipse.ditto.connectivity.api.ExternalMessageFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@ public void messageWithBytepayloadIsTransformedToExternalMessage() {
assertThat(externalMessage.getHeaders().get(KAFKA_TIMESTAMP.getName())).isEqualTo(Long.toString(TIMESTAMP));
}

@Test
public void temp() {
final String original = "Test";
final byte[] utf8Bytes = original.getBytes(StandardCharsets.UTF_8);
final byte[] originalBytes = original.getBytes(StandardCharsets.UTF_16);
System.out.println(new String(utf8Bytes, StandardCharsets.UTF_8));
System.out.println(new String(originalBytes, StandardCharsets.UTF_8));
System.out.println(new String(originalBytes, StandardCharsets.UTF_16));
}

@Test
public void messageWithUTF16CharsetTransformedToExternalMessage() {
final String deviceId = "ditto:test-device";
Expand Down

0 comments on commit 0479af1

Please sign in to comment.