Convert NotificationPopupTest to lambdas
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Change-Id: Ibecf3fbc1b9d1beb20731fb28b884ddbf9fc5a18
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/192435
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/tests/org.eclipse.jface.tests.notifications/src/org/eclipse/jface/tests/notifications/NotificationPopupTest.java b/tests/org.eclipse.jface.tests.notifications/src/org/eclipse/jface/tests/notifications/NotificationPopupTest.java
index fdeaeb3..fd2ceaf 100644
--- a/tests/org.eclipse.jface.tests.notifications/src/org/eclipse/jface/tests/notifications/NotificationPopupTest.java
+++ b/tests/org.eclipse.jface.tests.notifications/src/org/eclipse/jface/tests/notifications/NotificationPopupTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2021 SAP SE and others.
+ * Copyright (c) 2021, 2022 SAP SE and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -21,7 +21,6 @@
import java.util.Arrays;
import java.util.List;
-import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -90,14 +89,10 @@
public void createsWithTextContent() {
Text[] text = new Text[1];
NotificationPopup notication =
- this.builder.title("Hello World", false).content(new Function<Composite, Control>() {
-
- @Override
- public Control apply(Composite parent) {
- text[0] = new Text(parent, SWT.NONE);
- text[0].setText("My custom Text");
- return text[0];
- }
+ this.builder.title("Hello World", false).content(parent -> {
+ text[0] = new Text(parent, SWT.NONE);
+ text[0].setText("My custom Text");
+ return text[0];
}).delay(1).build();
notication.open();
@@ -110,14 +105,10 @@
@Test
public void createsWithTitleContent() {
Text[] text = new Text[1];
- NotificationPopup notication = this.builder.title(new Function<Composite, Control>() {
-
- @Override
- public Control apply(Composite parent) {
- text[0] = new Text(parent, SWT.NONE);
- text[0].setText("My custom Title");
- return text[0];
- }
+ NotificationPopup notication = this.builder.title(parent -> {
+ text[0] = new Text(parent, SWT.NONE);
+ text[0].setText("My custom Title");
+ return text[0];
}, false).delay(1).build();
notication.open();