@Test public void testAddDestinationDetailsToMapIfNeeded() throws JMSException { Queue queue = mock(Queue.class); when(queue.getQueueName()).thenReturn("mock-queue"); Operation op = new Operation(); OperationMap map = op.createMap("test-map"); addDestinationDetailsToMapIfNeeded(queue, map, null, Collections.<String>emptyList(), "test"); String type = map.get("test" + TYPE, String.class); String name = map.get("test" + NAME, String.class); assertNotNull(type); assertNotNull(name); assertEquals(type, DestinationType.Queue.name()); assertEquals(name, "mock-queue"); queue = null; op = new Operation(); map = op.createMap("test-map"); addDestinationDetailsToMapIfNeeded(queue, map, null, Collections.<String>emptyList(), "test"); type = map.get("test" + TYPE, String.class); name = map.get("test" + NAME, String.class); assertNull(type); assertNull(name); }
static OperationMap addDestinationDetailsToMapIfNeeded(Destination dest, OperationMap map, ObscuredValueMarker marker, Collection<String> nameSet, String prefix) throws JMSException { if (dest == null) { return map; } DestinationType destinationType = getDestinationType(dest); String destinationName = getDestinationName(dest, destinationType); updateAny(map, prefix + TYPE, destinationType.name(), marker, nameSet); updateAny(map, prefix + NAME, destinationName, marker, nameSet); return map; }
JMSPluginUtils { static OperationMap addDestinationDetailsToMapIfNeeded(Destination dest, OperationMap map, ObscuredValueMarker marker, Collection<String> nameSet, String prefix) throws JMSException { if (dest == null) { return map; } DestinationType destinationType = getDestinationType(dest); String destinationName = getDestinationName(dest, destinationType); updateAny(map, prefix + TYPE, destinationType.name(), marker, nameSet); updateAny(map, prefix + NAME, destinationName, marker, nameSet); return map; } }
JMSPluginUtils { static OperationMap addDestinationDetailsToMapIfNeeded(Destination dest, OperationMap map, ObscuredValueMarker marker, Collection<String> nameSet, String prefix) throws JMSException { if (dest == null) { return map; } DestinationType destinationType = getDestinationType(dest); String destinationName = getDestinationName(dest, destinationType); updateAny(map, prefix + TYPE, destinationType.name(), marker, nameSet); updateAny(map, prefix + NAME, destinationName, marker, nameSet); return map; } private  JMSPluginUtils(); }
JMSPluginUtils { static OperationMap addDestinationDetailsToMapIfNeeded(Destination dest, OperationMap map, ObscuredValueMarker marker, Collection<String> nameSet, String prefix) throws JMSException { if (dest == null) { return map; } DestinationType destinationType = getDestinationType(dest); String destinationName = getDestinationName(dest, destinationType); updateAny(map, prefix + TYPE, destinationType.name(), marker, nameSet); updateAny(map, prefix + NAME, destinationName, marker, nameSet); return map; } private  JMSPluginUtils();  }
JMSPluginUtils { static OperationMap addDestinationDetailsToMapIfNeeded(Destination dest, OperationMap map, ObscuredValueMarker marker, Collection<String> nameSet, String prefix) throws JMSException { if (dest == null) { return map; } DestinationType destinationType = getDestinationType(dest); String destinationName = getDestinationName(dest, destinationType); updateAny(map, prefix + TYPE, destinationType.name(), marker, nameSet); updateAny(map, prefix + NAME, destinationName, marker, nameSet); return map; } private  JMSPluginUtils();   }