File tree Expand file tree Collapse file tree 4 files changed +79
-0
lines changed
spring-test-activemq/src/test
java/com/jupiter/tools/spring/test/activemq/extension
spring-test-rabbitmq/src/test
java/com/jupiter/tools/spring/test/rabbitmq/extension Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import com .jupiter .tools .spring .test .activemq .annotation .ExpectedMessages ;
6
6
import com .jupiter .tools .spring .test .activemq .annotation .meta .EnableActiveMqTest ;
7
+ import com .jupiter .tools .spring .test .activemq .extension .expected .Bar ;
7
8
import com .jupiter .tools .spring .test .activemq .extension .expected .Foo ;
8
9
import com .jupiter .tools .spring .test .activemq .extension .expected .FooWithBar ;
9
10
import org .junit .jupiter .api .Test ;
@@ -54,6 +55,28 @@ void testExpectedWithDate() {
54
55
jmsTemplate .convertAndSend ("test-queue" , fooWithBar );
55
56
}
56
57
58
+ @ Test
59
+ @ ExpectedMessages (queue = "test-queue" , messagesFile = "/datasets/expected_partial.json" )
60
+ void testExpectedPartialFields () {
61
+
62
+ Foo childFoo = new Foo ("child foo" );
63
+ Bar childBar = new Bar ("child bar" , 1 );
64
+ FooWithBar child = FooWithBar .builder ()
65
+ .foo (childFoo )
66
+ .bar (childBar )
67
+ .build ();
68
+
69
+ Foo foo = new Foo ("parent foo" );
70
+ Bar bar = new Bar ("parent bar" , 2 );
71
+ FooWithBar fooWithBar = FooWithBar .builder ()
72
+ .foo (foo )
73
+ .bar (bar )
74
+ .child (child )
75
+ .build ();
76
+
77
+ jmsTemplate .convertAndSend ("test-queue" , fooWithBar );
78
+ }
79
+
57
80
@ TestConfiguration
58
81
public static class TestConfig {
59
82
@ Bean
Original file line number Diff line number Diff line change
1
+ {
2
+ "com.jupiter.tools.spring.test.activemq.extension.expected.FooWithBar" : [
3
+ {
4
+ "foo" : {
5
+ "value" : " parent foo"
6
+ },
7
+ "bar" : {
8
+ "name" : " parent bar"
9
+ },
10
+ "child" : {
11
+ "foo" : {
12
+ "value" : " child foo"
13
+ }
14
+ }
15
+ }
16
+ ]
17
+ }
Original file line number Diff line number Diff line change @@ -76,6 +76,28 @@ void testSendObjectWithNested() {
76
76
amqpTemplate .convertAndSend ("test-queue" , fooWithBar );
77
77
}
78
78
79
+ @ Test
80
+ @ ExpectedMessages (queue = "test-queue" , messagesFile = "/datasets/expected_partial.json" )
81
+ void testExpectedPartialFields () {
82
+
83
+ Foo childFoo = new Foo ("child foo" );
84
+ Bar childBar = new Bar ("child bar" , 1 );
85
+ FooWithBar child = FooWithBar .builder ()
86
+ .foo (childFoo )
87
+ .bar (childBar )
88
+ .build ();
89
+
90
+ Foo foo = new Foo ("parent foo" );
91
+ Bar bar = new Bar ("parent bar" , 2 );
92
+ FooWithBar fooWithBar = FooWithBar .builder ()
93
+ .foo (foo )
94
+ .bar (bar )
95
+ .child (child )
96
+ .build ();
97
+
98
+ amqpTemplate .convertAndSend ("test-queue" , fooWithBar );
99
+ }
100
+
79
101
@ Test
80
102
@ ExpectedMessages (queue = "test-queue" , messagesFile = "/datasets/expected_messages_with_js.json" )
81
103
void testExpectedDataSetWithJavaScript () {
Original file line number Diff line number Diff line change
1
+ {
2
+ "com.jupiter.tools.spring.test.rabbitmq.extension.pojo.FooWithBar" : [
3
+ {
4
+ "foo" : {
5
+ "value" : " parent foo"
6
+ },
7
+ "bar" : {
8
+ "name" : " parent bar"
9
+ },
10
+ "child" : {
11
+ "foo" : {
12
+ "value" : " child foo"
13
+ }
14
+ }
15
+ }
16
+ ]
17
+ }
You can’t perform that action at this time.
0 commit comments