### Question:
JmsProducer extends BaseStep implements StepInterface { private void setOptions( JMSProducer producer ) { String optionValue = variables.environmentSubstitute( meta.getDisableMessageId() ); getLogChannel().logDebug( "Disable Message ID is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDisableMessageID( BooleanUtils.toBoolean( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getDisableMessageTimestamp() ); getLogChannel().logDebug( "Disable Message Timestamp is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDisableMessageTimestamp( BooleanUtils.toBoolean( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getDeliveryMode() ); getLogChannel().logDebug( "Delivery Mode is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDeliveryMode( Integer.parseInt( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getPriority() ); getLogChannel().logDebug( "Priority is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setPriority( Integer.parseInt( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getTimeToLive() ); getLogChannel().logDebug( "Time to Live is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setTimeToLive( Long.parseLong( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getDeliveryDelay() ); getLogChannel().logDebug( "Delivery Delay is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDeliveryDelay( Long.parseLong( optionValue ) ); } optionValue = variables.environmentSubstitute( meta.getJmsCorrelationId() ); getLogChannel().logDebug( "JMS Correlation ID is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setJMSCorrelationID( optionValue ); } optionValue = variables.environmentSubstitute( meta.getJmsType() ); getLogChannel().logDebug( "JMS Type is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setJMSType( optionValue ); } } JmsProducer( StepMeta stepMeta,
                      StepDataInterface stepDataInterface, int copyNr,
                      TransMeta transMeta, Trans trans ); @Override boolean init( StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface ); @Override boolean processRow( StepMetaInterface smi, StepDataInterface sdi );  }### Answer:
@Test public void testSetOptions() throws KettleException { step.init( meta, data ); step.processRow( meta, data ); assertEquals( false, producer.getDisableMessageID() ); assertEquals( false, producer.getDisableMessageTimestamp() ); assertEquals( 2, producer.getDeliveryMode() ); assertEquals( 4, producer.getPriority() ); assertEquals( 0, producer.getTimeToLive() ); assertEquals( 0, producer.getDeliveryDelay() ); assertNull( producer.getJMSCorrelationID() ); assertNull( producer.getJMSType() ); meta.setDisableMessageId( "true" ); meta.setDisableMessageTimestamp( "false" ); meta.setDeliveryMode( "1" ); meta.setPriority( "2" ); meta.setTimeToLive( "3" ); meta.setDeliveryDelay( "4" ); meta.setJmsCorrelationId( "ASDF" ); meta.setJmsType( "JMSType" ); step.first = true; step.processRow( meta, data ); assertEquals( true, producer.getDisableMessageID() ); assertEquals( false, producer.getDisableMessageTimestamp() ); assertEquals( 1, producer.getDeliveryMode() ); assertEquals( 2, producer.getPriority() ); assertEquals( 3, producer.getTimeToLive() ); assertEquals( 4, producer.getDeliveryDelay() ); assertEquals( "ASDF", producer.getJMSCorrelationID() ); assertEquals( "JMSType", producer.getJMSType() ); }