2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.yamahareceiver.internal.protocol.xml;
15 import static org.mockito.ArgumentMatchers.anyString;
16 import static org.mockito.Mockito.when;
18 import org.mockito.Mock;
19 import org.openhab.binding.yamahareceiver.internal.config.YamahaZoneConfig;
20 import org.openhab.binding.yamahareceiver.internal.protocol.InputConverter;
21 import org.openhab.binding.yamahareceiver.internal.state.DeviceInformationState;
22 import org.openhab.binding.yamahareceiver.internal.state.ZoneControlStateListener;
27 * @author Tomasz Maruszak - Initial contribution
29 public abstract class AbstractZoneControlXMLTest extends AbstractXMLProtocolTest {
31 protected DeviceInformationState deviceInformationState;
33 protected @Mock InputConverter inputConverter;
34 protected @Mock ZoneControlStateListener zoneControlStateListener;
35 protected @Mock YamahaZoneConfig zoneConfig;
38 protected void onSetUp() throws Exception {
41 deviceInformationState = new DeviceInformationState();
43 when(zoneConfig.getVolumeDbMin()).thenReturn(-10f);
44 when(zoneConfig.getVolumeDbMax()).thenReturn(10f);
46 when(inputConverter.fromStateName(anyString())).thenAnswer(p -> p.getArgument(0));
47 when(inputConverter.toCommandName(anyString())).thenAnswer(p -> p.getArgument(0));