aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test/java/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/test/java/com/vaadin')
-rw-r--r--server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java17
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java6
2 files changed, 12 insertions, 11 deletions
diff --git a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java
index ac530c266f..0711ae24bf 100644
--- a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java
+++ b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java
@@ -235,15 +235,14 @@ public class BinderConverterValidatorTest
throw new IllegalArgumentException(
"Value must be OK or NOTOK");
}, model -> {
- switch (model) {
- case "1":
- return "OK";
- case "2":
- return "NOTOK";
- default:
- throw new IllegalArgumentException(
- "Value in model must be 1 or 2");
- }
+ if (model.equals("1")) {
+ return "OK";
+ } else if (model.equals("2")) {
+ return "NOTOK";
+ } else {
+ throw new IllegalArgumentException(
+ "Value in model must be 1 or 2");
+ }
});
binding.bind(StatusBean::getStatus, StatusBean::setStatus);
binder.setBean(bean);
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
index b8875c34fd..b13499983e 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
@@ -97,8 +97,10 @@ public class AbstractComponentDeclarativeTest
Boolean[] explicitImmediate = { null, Boolean.FALSE, Boolean.TRUE,
Boolean.TRUE };
boolean[] immediate = { true, false, true, true };
- for (String designElements : design) {
- component = (AbstractComponent) Design.read(new ByteArrayInputStream(designElements.getBytes(Charset.forName("UTF-8"))));
+ for (int i = 0; i < design.length; i++) {
+ component = (AbstractComponent) Design
+ .read(new ByteArrayInputStream(
+ design[i].getBytes(Charset.forName("UTF-8"))));
}
}