@@ -42,28 +42,28 @@ public class SuperStreamManagementTest {
42
42
static final int partitionCount = 3 ;
43
43
String s ;
44
44
List <String > partitions ;
45
- List <String > routingKeys ;
45
+ List <String > bindingKeys ;
46
46
47
47
@ BeforeEach
48
48
void init (TestInfo info ) {
49
49
s = streamName (info );
50
50
partitions = partitions (s );
51
- routingKeys = routingKeys ();
51
+ bindingKeys = bindingKeys ();
52
52
}
53
53
54
54
@ Test
55
55
@ TestUtils .BrokerVersionAtLeast (TestUtils .BrokerVersion .RABBITMQ_3_13_0 )
56
56
void createDelete () {
57
57
Client c = cf .get ();
58
- Client .Response response = c .createSuperStream (s , partitions , routingKeys , null );
58
+ Client .Response response = c .createSuperStream (s , partitions , bindingKeys , null );
59
59
assertThat (response ).is (ok ());
60
60
assertThat (c .metadata (partitions ))
61
61
.hasSameSizeAs (partitions )
62
62
.allSatisfy ((s , streamMetadata ) -> assertThat (streamMetadata .isResponseOk ()).isTrue ());
63
63
assertThat (c .partitions (s )).isEqualTo (partitions );
64
- routingKeys .forEach (rk -> assertThat (c .route (rk , s )).hasSize (1 ).contains (s + "-" + rk ));
64
+ bindingKeys .forEach (bk -> assertThat (c .route (bk , s )).hasSize (1 ).contains (s + "-" + bk ));
65
65
66
- response = c .createSuperStream (s , partitions , routingKeys , null );
66
+ response = c .createSuperStream (s , partitions , bindingKeys , null );
67
67
assertThat (response ).is (ko ()).is (responseCode (RESPONSE_CODE_STREAM_ALREADY_EXISTS ));
68
68
69
69
response = c .deleteSuperStream (s );
@@ -75,7 +75,7 @@ void createDelete() {
75
75
assertThat (streamMetadata .getResponseCode ())
76
76
.isEqualTo (RESPONSE_CODE_STREAM_DOES_NOT_EXIST ));
77
77
assertThat (c .partitions (s )).isEmpty ();
78
- routingKeys .forEach (rk -> assertThat (c .route (rk , s )).isEmpty ());
78
+ bindingKeys .forEach (bk -> assertThat (c .route (bk , s )).isEmpty ());
79
79
80
80
response = c .deleteSuperStream (s );
81
81
assertThat (response ).is (responseCode (RESPONSE_CODE_STREAM_DOES_NOT_EXIST ));
@@ -85,7 +85,7 @@ void createDelete() {
85
85
@ TestUtils .BrokerVersionAtLeast (TestUtils .BrokerVersion .RABBITMQ_3_13_0 )
86
86
void clientWithSubscriptionShouldReceiveNotificationOnDeletion () throws Exception {
87
87
Client c = cf .get ();
88
- Client .Response response = c .createSuperStream (s , partitions , routingKeys , null );
88
+ Client .Response response = c .createSuperStream (s , partitions , bindingKeys , null );
89
89
assertThat (response ).is (ok ());
90
90
Map <String , Short > notifications = new ConcurrentHashMap <>(partitions .size ());
91
91
AtomicInteger notificationCount = new AtomicInteger ();
@@ -114,37 +114,37 @@ void clientWithSubscriptionShouldReceiveNotificationOnDeletion() throws Exceptio
114
114
@ TestUtils .BrokerVersionAtLeast (TestUtils .BrokerVersion .RABBITMQ_3_13_0 )
115
115
void authorisation () throws Exception {
116
116
String user = "stream" ;
117
- // routing keys do not matter for authorisation
118
- routingKeys = asList ("1" , "2" , "3" );
117
+ // binding keys do not matter for authorisation
118
+ bindingKeys = asList ("1" , "2" , "3" );
119
119
try {
120
120
addUser (user , user );
121
121
setPermissions (user , asList ("stream|partition.*$" , "partition.*$" , "stream.*$" ));
122
122
Client c = cf .get (new Client .ClientParameters ().username (user ).password (user ));
123
- Client .Response response = c .createSuperStream ("not-allowed" , partitions , routingKeys , null );
123
+ Client .Response response = c .createSuperStream ("not-allowed" , partitions , bindingKeys , null );
124
124
assertThat (response ).is (ko ()).is (responseCode (RESPONSE_CODE_ACCESS_REFUSED ));
125
125
126
126
s = name ("stream" );
127
- response = c .createSuperStream (s , asList ("1" , "2" , "3" ), routingKeys , null );
127
+ response = c .createSuperStream (s , asList ("1" , "2" , "3" ), bindingKeys , null );
128
128
assertThat (response ).is (ko ()).is (responseCode (RESPONSE_CODE_ACCESS_REFUSED ));
129
129
130
130
partitions = range (0 , partitionCount ).mapToObj (i -> s + "-" + i ).collect (toList ());
131
131
// we can create the queues, but can't bind them, as it requires write permission
132
- response = c .createSuperStream (s , partitions , routingKeys , null );
132
+ response = c .createSuperStream (s , partitions , bindingKeys , null );
133
133
assertThat (response ).is (ko ()).is (responseCode (RESPONSE_CODE_ACCESS_REFUSED ));
134
134
135
135
String partitionName = name ("partition" );
136
136
partitions =
137
137
range (0 , partitionCount ).mapToObj (i -> partitionName + "-" + i ).collect (toList ());
138
- response = c .createSuperStream (s , partitions , routingKeys , null );
138
+ response = c .createSuperStream (s , partitions , bindingKeys , null );
139
139
assertThat (response ).is (ok ());
140
140
141
141
assertThat (c .metadata (partitions ))
142
142
.hasSameSizeAs (partitions )
143
143
.allSatisfy ((s , streamMetadata ) -> assertThat (streamMetadata .isResponseOk ()).isTrue ());
144
144
assertThat (c .partitions (s )).isEqualTo (partitions );
145
- for (int i = 0 ; i < routingKeys .size (); i ++) {
146
- String rk = routingKeys .get (i );
147
- assertThat (c .route (rk , s )).hasSize (1 ).contains (partitions .get (i ));
145
+ for (int i = 0 ; i < bindingKeys .size (); i ++) {
146
+ String bk = bindingKeys .get (i );
147
+ assertThat (c .route (bk , s )).hasSize (1 ).contains (partitions .get (i ));
148
148
}
149
149
150
150
response = c .deleteSuperStream (s );
@@ -154,11 +154,11 @@ void authorisation() throws Exception {
154
154
}
155
155
}
156
156
157
- private static List <String > routingKeys () {
158
- return routingKeys (partitionCount );
157
+ private static List <String > bindingKeys () {
158
+ return bindingKeys (partitionCount );
159
159
}
160
160
161
- private static List <String > routingKeys (int partitions ) {
161
+ private static List <String > bindingKeys (int partitions ) {
162
162
return range (0 , partitions ).mapToObj (String ::valueOf ).collect (toList ());
163
163
}
164
164
0 commit comments