Source:
<code>void createQueue() { final String queueName = "some-queue"; final CreateQueueOptions expected = new CreateQueueOptions(queueName) .setAutoDeleteOnIdle(Duration.ofSeconds(15)) .setDefaultMessageTimeToLive(Duration.ofSeconds(50)) .setDeadLetteringOnMessageExpiration(true) .setDuplicateDetectionHistoryTimeWindow(Duration.ofSeconds(13)) .setEnableBatchedOperations(false) .setEnablePartitioning(true) .setForwardTo("Forward-To-This-Queue") .setForwardDeadLetteredMessagesTo("Dead-Lettered-Forward-To") .setLockDuration(Duration.ofSeconds(120)) .setMaxDeliveryCount(15) <START> .setMaxSizeInMegabytes(2048) <END> .setRequiresDuplicateDetection(true) .setRequiresSession(true) .setUserMetadata("Test-queue-Metadata") .setStatus(EntityStatus.DISABLED); final QueueProperties actual = EntityHelper.createQueue(expected); assertEquals(expected.getName(), actual.getName()); assertEquals(expected.getAutoDeleteOnIdle(), actual.getAutoDeleteOnIdle()); assertEquals(expected.getDefaultMessageTimeToLive(), actual.getDefaultMessageTimeToLive()); assertEquals(expected.deadLetteringOnMessageExpiration(), actual.deadLetteringOnMessageExpiration()); assertEquals(expected.getDuplicateDetectionHistoryTimeWindow(), actual.getDuplicateDetectionHistoryTimeWindow()); assertEquals(expected.enableBatchedOperations(), actual.enableBatchedOperations()); assertEquals(expected.enablePartitioning(), actual.enablePartitioning()); assertEquals(expected.getForwardTo(), actual.getForwardTo()); assertEquals(expected.getForwardDeadLetteredMessagesTo(), actual.getForwardDeadLetteredMessagesTo()); assertEquals(expected.getLockDuration(), actual.getLockDuration()); assertEquals(expected.getMaxDeliveryCount(), actual.getMaxDeliveryCount()); assertEquals(expected.requiresDuplicateDetection(), actual.requiresDuplicateDetection()); assertEquals(expected.requiresSession(), actual.requiresSession()); assertEquals(expected.getUserMetadata(), actual.getUserMetadata()); assertEquals(expected.getStatus(), actual.getStatus()); }</code><technical_language>If set negative values numbers, validate values</technical_language>

Target:
void createQueue() { final String queueName = "some-queue"; final CreateQueueOptions expected = new CreateQueueOptions(queueName) .setAutoDeleteOnIdle(Duration.ofSeconds(15)) .setDefaultMessageTimeToLive(Duration.ofSeconds(50)) .setDeadLetteringOnMessageExpiration(true) .setDuplicateDetectionHistoryTimeWindow(Duration.ofSeconds(13)) .setEnableBatchedOperations(false) .setEnablePartitioning(true) .setForwardTo("Forward-To-This-Queue") .setForwardDeadLetteredMessagesTo("Dead-Lettered-Forward-To") .setLockDuration(Duration.ofSeconds(120)) .setMaxDeliveryCount(15) .setMaxSizeInMegabytes(2048) .setRequiresDuplicateDetection(true) .setRequiresSession(true) .setUserMetadata("Test-queue-Metadata") .setStatus(EntityStatus.DISABLED); final QueueDescription actual = EntityHelper.getQueueDescription(expected); assertEquals(expected.getAutoDeleteOnIdle(), actual.getAutoDeleteOnIdle()); assertEquals(expected.getDefaultMessageTimeToLive(), actual.getDefaultMessageTimeToLive()); assertEquals(expected.deadLetteringOnMessageExpiration(), actual.isDeadLetteringOnMessageExpiration()); assertEquals(expected.getDuplicateDetectionHistoryTimeWindow(), actual.getDuplicateDetectionHistoryTimeWindow()); assertEquals(expected.enableBatchedOperations(), actual.isEnableBatchedOperations()); assertEquals(expected.enablePartitioning(), actual.isEnablePartitioning()); assertEquals(expected.getForwardTo(), actual.getForwardTo()); assertEquals(expected.getForwardDeadLetteredMessagesTo(), actual.getForwardDeadLetteredMessagesTo()); assertEquals(expected.getLockDuration(), actual.getLockDuration()); assertEquals(expected.getMaxDeliveryCount(), actual.getMaxDeliveryCount()); assertEquals(expected.requiresDuplicateDetection(), actual.isRequiresDuplicateDetection()); assertEquals(expected.requiresSession(), actual.isRequiresSession()); assertEquals(expected.getUserMetadata(), actual.getUserMetadata()); assertEquals(expected.getStatus(), actual.getStatus()); }