File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
bolt/src/test/java/test_locally/app Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1313import com .slack .api .bolt .request .builtin .GlobalShortcutRequest ;
1414import com .slack .api .bolt .response .Response ;
1515import com .slack .api .bolt .service .InstallationService ;
16+ import com .slack .api .methods .MethodsConfig ;
1617import com .slack .api .methods .SlackApiException ;
1718import lombok .extern .slf4j .Slf4j ;
1819import org .eclipse .jetty .server .Server ;
4344public class MultiTeamsAuthTestCacheTest {
4445
4546 static SlackConfig config = new SlackConfig ();
47+ static {
48+ MethodsConfig methodsConfig = new MethodsConfig ();
49+ methodsConfig .setStatsEnabled (false ); // To skip TeamIdCache requests
50+ config .setMethodsConfig (methodsConfig );
51+ }
52+
4653 static Slack slack = Slack .getInstance (config );
4754 static CountdownAuthTestServer server = new CountdownAuthTestServer ();
4855
@@ -192,7 +199,7 @@ public static class CountdownAuthTestMockEndpoint extends HttpServlet {
192199 @ Override
193200 protected void doPost (HttpServletRequest req , HttpServletResponse resp ) throws IOException {
194201 String token = req .getHeader ("Authorization" ).replaceFirst ("Bearer " , "" );
195- int count = remaining .computeIfAbsent (token , (t ) -> new AtomicInteger (2 )).getAndDecrement ();
202+ int count = remaining .computeIfAbsent (token , (t ) -> new AtomicInteger (1 )).getAndDecrement ();
196203 if (count <= 0 ) {
197204 resp .setStatus (500 );
198205 return ;
Original file line number Diff line number Diff line change 88import com .slack .api .bolt .request .RequestHeaders ;
99import com .slack .api .bolt .request .builtin .GlobalShortcutRequest ;
1010import com .slack .api .bolt .response .Response ;
11+ import com .slack .api .methods .MethodsConfig ;
1112import com .slack .api .methods .SlackApiException ;
1213import lombok .extern .slf4j .Slf4j ;
1314import org .eclipse .jetty .server .Server ;
3839public class SingleTeamAuthTestCacheTest {
3940
4041 static SlackConfig config = new SlackConfig ();
42+ static {
43+ MethodsConfig methodsConfig = new MethodsConfig ();
44+ methodsConfig .setStatsEnabled (false ); // To skip TeamIdCache requests
45+ config .setMethodsConfig (methodsConfig );
46+ }
4147 static Slack slack = Slack .getInstance (config );
4248 static CountdownAuthTestServer server = new CountdownAuthTestServer ();
4349
@@ -154,7 +160,7 @@ public static class CountdownAuthTestMockEndpoint extends HttpServlet {
154160 @ Override
155161 protected void doPost (HttpServletRequest req , HttpServletResponse resp ) throws IOException {
156162 String token = req .getHeader ("Authorization" ).replaceFirst ("Bearer " , "" );
157- int count = remaining .computeIfAbsent (token , (t ) -> new AtomicInteger (2 )).getAndDecrement ();
163+ int count = remaining .computeIfAbsent (token , (t ) -> new AtomicInteger (1 )).getAndDecrement ();
158164 if (count <= 0 ) {
159165 resp .setStatus (500 );
160166 return ;
You can’t perform that action at this time.
0 commit comments