@@ -45,14 +45,14 @@ public void testGenerateTenantTokenWithOnlySearchRules() throws Exception {
45
45
Index index = createEmptyIndex (indexUid );
46
46
Key key = getPrivateKey ();
47
47
48
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
48
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
49
49
50
50
Map <String , Object > rules = new HashMap <String , Object >();
51
51
rules .put ("*" , new HashMap <String , Object >());
52
52
53
53
String jwtToken = privateClient .generateTenantToken (rules );
54
54
55
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
55
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
56
56
57
57
assertDoesNotThrow (() -> tokenClient .index (indexUid ).search ("" ));
58
58
}
@@ -64,14 +64,14 @@ public void testGenerateTenantTokenOnOneIndex() throws Exception {
64
64
Index index = createEmptyIndex (indexUid );
65
65
Key key = getPrivateKey ();
66
66
67
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
67
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
68
68
69
69
Map <String , Object > rules = new HashMap <String , Object >();
70
70
rules .put (indexUid , new HashMap <String , Object >());
71
71
72
72
String jwtToken = privateClient .generateTenantToken (rules );
73
73
74
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
74
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
75
75
76
76
assertDoesNotThrow (() -> tokenClient .index (indexUid ).search ("" ));
77
77
}
@@ -82,7 +82,7 @@ public void testGenerateTenantTokenWithFilter() throws Exception {
82
82
Key key = getPrivateKey ();
83
83
String indexUid = "GenerateTokenwithFilter" ;
84
84
85
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
85
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
86
86
87
87
Map <String , Object > filters = new HashMap <String , Object >();
88
88
filters .put ("filter" , "id > 1" );
@@ -91,7 +91,7 @@ public void testGenerateTenantTokenWithFilter() throws Exception {
91
91
92
92
String jwtToken = privateClient .generateTenantToken (rules );
93
93
94
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
94
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
95
95
96
96
Index index = client .index (indexUid );
97
97
TestData <Movie > testData = this .getTestData (MOVIES_INDEX , Movie .class );
@@ -116,7 +116,7 @@ public void testGenerateTenantTokenWithExpiresAt() throws Exception {
116
116
Index index = createEmptyIndex (indexUid );
117
117
Key key = getPrivateKey ();
118
118
119
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
119
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
120
120
121
121
Map <String , Object > rules = new HashMap <String , Object >();
122
122
rules .put ("*" , new HashMap <String , Object >());
@@ -129,7 +129,7 @@ public void testGenerateTenantTokenWithExpiresAt() throws Exception {
129
129
130
130
String jwtToken = privateClient .generateTenantToken (rules , options );
131
131
132
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
132
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
133
133
134
134
assertDoesNotThrow (() -> tokenClient .index (indexUid ).search ("" ));
135
135
}
@@ -149,7 +149,7 @@ public void testGenerateTenantTokenWithApiKey() throws Exception {
149
149
150
150
String jwtToken = client .generateTenantToken (rules , options );
151
151
152
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
152
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
153
153
154
154
assertDoesNotThrow (() -> tokenClient .index (indexUid ).search ("" ));
155
155
}
@@ -173,7 +173,7 @@ public void testGenerateTenantTokenWithAllOptions() throws Exception {
173
173
174
174
String jwtToken = client .generateTenantToken (rules , options );
175
175
176
- Client tokenClient = new Client (new Config ("http://localhost:7700" , jwtToken ));
176
+ Client tokenClient = new Client (new Config (getMeilisearchHost () , jwtToken ));
177
177
178
178
assertDoesNotThrow (() -> tokenClient .index (indexUid ).search ("" ));
179
179
}
@@ -184,7 +184,7 @@ public void testGenerateTenantTokenWithNoSearchRules() throws Exception {
184
184
String indexUid = "GenerateTokenWithNoSearchRules" ;
185
185
Key key = getPrivateKey ();
186
186
187
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
187
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
188
188
189
189
assertThrows (MeiliSearchException .class , () -> privateClient .generateTenantToken (null ));
190
190
}
@@ -195,7 +195,7 @@ public void testGenerateTenantTokenWithBadExpiresAt() throws Exception {
195
195
String indexUid = "GenerateTenantTokenWithBadExpiresAt" ;
196
196
Key key = getPrivateKey ();
197
197
198
- Client privateClient = new Client (new Config ("http://localhost:7700" , key .getKey ()));
198
+ Client privateClient = new Client (new Config (getMeilisearchHost () , key .getKey ()));
199
199
200
200
Map <String , Object > rules = new HashMap <String , Object >();
201
201
rules .put ("*" , new HashMap <String , Object >());
@@ -217,7 +217,7 @@ public void testGenerateTenantTokenWithBadExpiresAt() throws Exception {
217
217
public void testGenerateTenantTokenWithEmptyApiKey () throws Exception {
218
218
String indexUid = "GenerateTenantTokenWithEmptyApiKey" ;
219
219
220
- Client privateClient = new Client (new Config ("http://localhost:7700" ));
220
+ Client privateClient = new Client (new Config (getMeilisearchHost () ));
221
221
222
222
Map <String , Object > rules = new HashMap <String , Object >();
223
223
rules .put ("*" , new HashMap <String , Object >());
0 commit comments