[mielecloud] Fix tests by adding missing email configuration parameter (#12056)
The validation did not fail previously because it was broken and fixed in https://github.com/openhab/openhab-core/pull/2683 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
fee45a5b94
commit
bfe059c585
|
@ -18,7 +18,7 @@ import static org.mockito.Mockito.*;
|
||||||
import static org.openhab.binding.mielecloud.internal.util.MieleCloudBindingIntegrationTestConstants.*;
|
import static org.openhab.binding.mielecloud.internal.util.MieleCloudBindingIntegrationTestConstants.*;
|
||||||
import static org.openhab.binding.mielecloud.internal.util.ReflectionUtil.*;
|
import static org.openhab.binding.mielecloud.internal.util.ReflectionUtil.*;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -126,9 +126,8 @@ public class MieleBridgeHandlerTest extends OpenHabOsgiTest {
|
||||||
bridge = BridgeBuilder
|
bridge = BridgeBuilder
|
||||||
.create(MieleCloudBindingConstants.THING_TYPE_BRIDGE,
|
.create(MieleCloudBindingConstants.THING_TYPE_BRIDGE,
|
||||||
MieleCloudBindingIntegrationTestConstants.BRIDGE_THING_UID)
|
MieleCloudBindingIntegrationTestConstants.BRIDGE_THING_UID)
|
||||||
.withConfiguration(
|
.withConfiguration(new Configuration(Map.of(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL,
|
||||||
new Configuration(Collections.singletonMap(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL,
|
MieleCloudBindingIntegrationTestConstants.EMAIL)))
|
||||||
MieleCloudBindingIntegrationTestConstants.EMAIL)))
|
|
||||||
.withLabel(MIELE_CLOUD_ACCOUNT_LABEL).build();
|
.withLabel(MIELE_CLOUD_ACCOUNT_LABEL).build();
|
||||||
assertNotNull(bridge);
|
assertNotNull(bridge);
|
||||||
|
|
||||||
|
@ -484,7 +483,8 @@ public class MieleBridgeHandlerTest extends OpenHabOsgiTest {
|
||||||
@Test
|
@Test
|
||||||
public void testNoLanguageIsReturnedWhenTheConfigurationParameterIsEmpty() {
|
public void testNoLanguageIsReturnedWhenTheConfigurationParameterIsEmpty() {
|
||||||
// given:
|
// given:
|
||||||
getHandler().handleConfigurationUpdate(Collections.singletonMap(CONFIG_PARAM_LOCALE, ""));
|
getHandler().handleConfigurationUpdate(
|
||||||
|
Map.of(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL, SERVICE_HANDLE, CONFIG_PARAM_LOCALE, ""));
|
||||||
|
|
||||||
// when:
|
// when:
|
||||||
Optional<String> language = getHandler().getLanguage();
|
Optional<String> language = getHandler().getLanguage();
|
||||||
|
@ -496,7 +496,8 @@ public class MieleBridgeHandlerTest extends OpenHabOsgiTest {
|
||||||
@Test
|
@Test
|
||||||
public void testNoLanguageIsReturnedWhenTheConfigurationParameterIsNotAValidTwoLetterLanguageCode() {
|
public void testNoLanguageIsReturnedWhenTheConfigurationParameterIsNotAValidTwoLetterLanguageCode() {
|
||||||
// given:
|
// given:
|
||||||
getHandler().handleConfigurationUpdate(Collections.singletonMap(CONFIG_PARAM_LOCALE, "Deutsch"));
|
getHandler().handleConfigurationUpdate(
|
||||||
|
Map.of(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL, SERVICE_HANDLE, CONFIG_PARAM_LOCALE, "Deutsch"));
|
||||||
|
|
||||||
// when:
|
// when:
|
||||||
Optional<String> language = getHandler().getLanguage();
|
Optional<String> language = getHandler().getLanguage();
|
||||||
|
@ -508,7 +509,8 @@ public class MieleBridgeHandlerTest extends OpenHabOsgiTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAValidTwoLetterLanguageCodeIsReturnedWhenTheConfigurationParameterIsSetToTheTwoLetterLanguageCode() {
|
public void testAValidTwoLetterLanguageCodeIsReturnedWhenTheConfigurationParameterIsSetToTheTwoLetterLanguageCode() {
|
||||||
// given:
|
// given:
|
||||||
getHandler().handleConfigurationUpdate(Collections.singletonMap(CONFIG_PARAM_LOCALE, "DE"));
|
getHandler().handleConfigurationUpdate(
|
||||||
|
Map.of(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL, SERVICE_HANDLE, CONFIG_PARAM_LOCALE, "DE"));
|
||||||
|
|
||||||
// when:
|
// when:
|
||||||
String language = getHandler().getLanguage().get();
|
String language = getHandler().getLanguage().get();
|
||||||
|
|
Loading…
Reference in New Issue