Skip to content

Commit 91d7a1b

Browse files
author
tehalexf
committed
#104 Added testing files
1 parent eaa6ec9 commit 91d7a1b

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.dcsc.athena.controllers;
2+
3+
import org.springframework.messaging.handler.annotation.MessageMapping;
4+
import org.springframework.messaging.handler.annotation.SendTo;
5+
import org.springframework.stereotype.Controller;
6+
7+
import org.dcsc.athena.objects.Greeting;
8+
import org.dcsc.athena.objects.HelloMessage;
9+
10+
@Controller
11+
public class GreetingController {
12+
13+
14+
@MessageMapping("/hello")
15+
@SendTo("/topic/greetings")
16+
public Greeting greeting(HelloMessage message) throws Exception {
17+
Thread.sleep(3000); // simulated delay
18+
return new Greeting("Hello, " + message.getName() + "!");
19+
}
20+
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.dcsc.athena.objects;
2+
3+
public class Greeting {
4+
5+
private String content;
6+
7+
public Greeting(String content) {
8+
this.content = content;
9+
}
10+
11+
public String getContent() {
12+
return content;
13+
}
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.dcsc.athena.objects;
2+
3+
public class HelloMessage {
4+
5+
private String name;
6+
7+
public String getName() {
8+
return name;
9+
}
10+
11+
}

src/main/resources

Submodule resources updated from 3c2986c to 5f27ed4

0 commit comments

Comments
 (0)