### Question:
OvsdbOperationalCommandAggregator implements TransactionCommand { public OvsdbOperationalCommandAggregator(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema, boolean initialUpdate) { this.initialUpdate = initialUpdate; commands.add(new OpenVSwitchUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema)); commands.add(new OvsdbManagersUpdateCommand(key, updates, dbSchema)); commands.add(new OvsdbManagersRemovedCommand(key, updates, dbSchema)); commands.add(new OvsdbQosUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema)); commands.add(new OvsdbQosRemovedCommand(key, updates, dbSchema)); commands.add(new OvsdbQueueUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema)); commands.add(new OvsdbQueueRemovedCommand(key, updates, dbSchema)); commands.add(new OvsdbBridgeUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema, updatedBridgeNodes)); commands.add(new OvsdbBridgeRemovedCommand(instanceIdentifierCodec, key, updates, dbSchema)); commands.add(new OvsdbControllerUpdateCommand(key, updates, dbSchema)); commands.add(new OvsdbControllerRemovedCommand(instanceIdentifierCodec, key, updates, dbSchema)); if (initialUpdate) { commands.add(new OvsdbInitialPortUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema, updatedBridgeNodes)); } else { commands.add(new OvsdbPortUpdateCommand(instanceIdentifierCodec, key, updates, dbSchema)); } commands.add(new OvsdbPortRemoveCommand(instanceIdentifierCodec, key, updates, dbSchema)); if (dbSchema.getVersion().compareTo( Version.fromString(SouthboundConstants.AUTOATTACH_SUPPORTED_OVS_SCHEMA_VERSION)) >= 0) { commands.add(new OvsdbAutoAttachUpdateCommand(key, updates, dbSchema)); commands.add(new OvsdbAutoAttachRemovedCommand(key, updates, dbSchema)); } else { LOG.debug("UNSUPPORTED FUNCTIONALITY: AutoAttach not supported in OVS schema version {}", dbSchema.getVersion().toString()); } } OvsdbOperationalCommandAggregator(InstanceIdentifierCodec instanceIdentifierCodec,
            OvsdbConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema, boolean initialUpdate); @Override void execute(ReadWriteTransaction transaction); @Override void onSuccess(); @Override void onFailure(Throwable throwable);  }### Answer:
@Test public void testOvsdbOperationalCommandAggregator() throws Exception { OvsdbConnectionInstance key = mock(OvsdbConnectionInstance.class); TableUpdates updates = mock(TableUpdates.class); DatabaseSchema dbSchema = mock(DatabaseSchema.class); when(dbSchema.getVersion()) .thenReturn(Version.fromString(SouthboundConstants.AUTOATTACH_SUPPORTED_OVS_SCHEMA_VERSION)); OvsdbOperationalCommandAggregator ovsdbOperationalCommandAggregator1 = new OvsdbOperationalCommandAggregator( mock(InstanceIdentifierCodec.class), key, updates, dbSchema, false); List<TransactionCommand> testCommands = Whitebox.getInternalState(ovsdbOperationalCommandAggregator1, "commands"); assertEquals(NUMBER_OF_COMMANDS, testCommands.size()); }