### Question:
AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements JmsBytesMessageFacade { @Override public int getBodyLength() { return getBinaryFromBody().getLength(); }  @Override AmqpJmsBytesMessageFacade copy(); @Override byte getJmsMsgType(); @Override void clearBody(); @Override InputStream getInputStream(); @Override OutputStream getOutputStream(); @Override void reset(); @Override int getBodyLength(); @Override boolean hasBody(); @Override JmsBytesMessage asJmsMessage(); @Override byte[] copyBody(); @Override void onSend(long producerTtl);  }### Answer:
@Test public void testGetBodyLengthUsingNewMessage() throws Exception { AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createNewBytesMessageFacade(); assertEquals("Message reports unexpected length", 0, amqpBytesMessageFacade.getBodyLength()); }
@Test public void testGetBodyLengthUsingReceivedMessageWithDataSectionContainingNonZeroLengthBinary() throws Exception { Message message = Message.Factory.create(); int length = 5; message.setBody(new Data(new Binary(new byte[length]))); AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(), message); assertEquals("Message reports unexpected length", length, amqpBytesMessageFacade.getBodyLength()); }
@Test public void testGetBodyLengthUsingReceivedMessageWithAmqpValueSectionContainingNonZeroLengthBinary() throws Exception { Message message = Message.Factory.create(); int length = 10; message.setBody(new AmqpValue(new Binary(new byte[length]))); AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(), message); assertEquals("Message reports unexpected length", length, amqpBytesMessageFacade.getBodyLength()); }
@Test public void testGetBodyLengthUsingReceivedMessageWithAmqpValueSectionContainingZeroLengthBinary() throws Exception { Message message = Message.Factory.create(); message.setBody(new AmqpValue(new Binary(new byte[0]))); AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(), message); assertEquals("Message reports unexpected length", 0, amqpBytesMessageFacade.getBodyLength()); }
@Test public void testGetBodyLengthUsingReceivedMessageWithAmqpValueSectionContainingNull() throws Exception { Message message = Message.Factory.create(); message.setBody(new AmqpValue(null)); AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(), message); assertEquals("Message reports unexpected length", 0, amqpBytesMessageFacade.getBodyLength()); }