summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-06-24 23:28:22 +0300
committerArtur Signell <artur@vaadin.com>2015-06-25 19:45:30 +0300
commit10e7a466bc936737b81005cb50d90c8bc8ca49bd (patch)
tree81dfcfafb2c8a14eab90a4bb12c0fdac48d7563a /server/tests
parent7552e9c4aa3c5bb7e7a4e5cfe50f4829a7c452af (diff)
downloadvaadin-framework-10e7a466bc936737b81005cb50d90c8bc8ca49bd.tar.gz
vaadin-framework-10e7a466bc936737b81005cb50d90c8bc8ca49bd.zip
Pass critical notification details to the client (#18342)
Change-Id: I3c4eace624453eb854a32fef5fe44d253b164f62
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/server/VaadinServiceTest.java45
1 files changed, 23 insertions, 22 deletions
diff --git a/server/tests/src/com/vaadin/server/VaadinServiceTest.java b/server/tests/src/com/vaadin/server/VaadinServiceTest.java
index 4b655e7855..bd3da6277a 100644
--- a/server/tests/src/com/vaadin/server/VaadinServiceTest.java
+++ b/server/tests/src/com/vaadin/server/VaadinServiceTest.java
@@ -42,9 +42,10 @@ public class VaadinServiceTest {
}
}
- private String createCriticalNotification(String caption, String message, String details, String url) {
- return VaadinService
- .createCriticalNotificationJSON(caption, message, details, url);
+ private String createCriticalNotification(String caption, String message,
+ String details, String url) {
+ return VaadinService.createCriticalNotificationJSON(caption, message,
+ details, url);
}
@Test
@@ -77,64 +78,64 @@ public class VaadinServiceTest {
@Test
public void captionIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification("foobar", "message", "details", "url");
+ String notification = createCriticalNotification("foobar", "message",
+ "details", "url");
assertThat(notification, containsString("\"caption\":\"foobar\""));
}
@Test
public void nullCaptionIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification(null, "message", "details", "url");
+ String notification = createCriticalNotification(null, "message",
+ "details", "url");
assertThat(notification, containsString("\"caption\":null"));
}
@Test
public void messageWithDetailsIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification("caption", "foo", "bar", "url");
+ String notification = createCriticalNotification("caption", "foo",
+ "bar", "url");
- assertThat(notification, containsString("\"message\":\"foo<br/><br/>bar\""));
+ assertThat(notification, containsString("\"details\":\"bar\""));
}
@Test
- public void nullMessageIsReplacedByDetailsInACriticalNotification() {
- String notification =
- createCriticalNotification("caption", null, "foobar", "url");
+ public void nullMessageSentAsNullInACriticalNotification() {
+ String notification = createCriticalNotification("caption", null,
+ "foobar", "url");
- assertThat(notification, containsString("\"message\":\"foobar\""));
+ assertThat(notification, containsString("\"message\":null"));
}
@Test
public void nullMessageIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification("caption", null, null, "url");
+ String notification = createCriticalNotification("caption", null, null,
+ "url");
assertThat(notification, containsString("\"message\":null"));
}
@Test
public void messageSetToACriticalNotification() {
- String notification =
- createCriticalNotification("caption", "foobar", null, "url");
+ String notification = createCriticalNotification("caption", "foobar",
+ null, "url");
assertThat(notification, containsString("\"message\":\"foobar\""));
}
@Test
public void urlIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification("caption", "message", "details", "foobar");
+ String notification = createCriticalNotification("caption", "message",
+ "details", "foobar");
assertThat(notification, containsString("\"url\":\"foobar\""));
}
@Test
public void nullUrlIsSetToACriticalNotification() {
- String notification =
- createCriticalNotification("caption", "message", "details", null);
+ String notification = createCriticalNotification("caption", "message",
+ "details", null);
assertThat(notification, containsString("\"url\":null"));
}