Skip to content

Commit

Permalink
Fix deprecated warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Oct 1, 2024
1 parent e86c6cd commit 2775b1d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public Response exchangeCodeForToken(String code, String nonce, String redirectL
TokenRequest tokenRequest = new TokenRequest(
oauthConfig.getTokenEndpoint(),
new ClientSecretBasic(new ClientID(oauthConfig.getClientId()), new Secret(oauthConfig.getClientSecret())),
new AuthorizationCodeGrant(new AuthorizationCode(code), oauthConfig.getRedirectUrl()));
new AuthorizationCodeGrant(new AuthorizationCode(code), oauthConfig.getRedirectUrl()),
null);

TokenResponse tokenResponse;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public static void setUpBackend(
{
RequestBody requestBody =
RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
"{ \"name\": \""
+ name
+ "\",\"proxyTo\": \""
Expand All @@ -151,7 +150,8 @@ public static void setUpBackend(
+ active
+ ",\"routingGroup\": \""
+ routingGroup
+ "\"}");
+ "\"}",
MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/entity?entityType=GATEWAY_BACKEND")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testRequestDelivery()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "SELECT * from system.runtime.nodes");
RequestBody.create("SELECT * from system.runtime.nodes", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/v1/statement")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void testRequestDelivery()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "SELECT 1");
RequestBody.create("SELECT 1", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/v1/statement")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void testDeleteResourceGroupOk()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/trino/resourcegroup/delete/3")
Expand All @@ -230,7 +230,7 @@ void testDeleteResourceGroupNoId()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/trino/resourcegroup/delete/")
Expand All @@ -246,7 +246,7 @@ void testDeleteGlobalPropertyOk()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/trino/globalproperty/delete/cpu_quota_period")
Expand All @@ -262,7 +262,7 @@ void testDeleteGlobalPropertyNoName()
throws Exception
{
RequestBody requestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
Request request =
new Request.Builder()
.url("http://localhost:" + routerPort + "/trino/globalproperty/delete/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private List<String> getRoles(String credentials)
private Response makeRequest(Optional<String> credentials)
throws IOException
{
RequestBody emptyRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
RequestBody emptyRequestBody = RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
Request.Builder builder = new Request.Builder()
.url("http://localhost:" + routerPort + "/userinfo")
.post(emptyRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void testSuccessfulCookieAuthentication()
.when(requestContext.getCookies())
.thenReturn(
Map.of(SessionCookie.OAUTH_ID_TOKEN,
new Cookie(SessionCookie.OAUTH_ID_TOKEN, ID_TOKEN)));
new Cookie.Builder(SessionCookie.OAUTH_ID_TOKEN).value(ID_TOKEN).build()));
Mockito
.when(requestContext.getHeaders())
.thenReturn(new MultivaluedHashMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class TestLbLdapClient
public void initMocks()
{
log.info("initializing test");
org.mockito.MockitoAnnotations.initMocks(this);
org.mockito.MockitoAnnotations.openMocks(this);
}

@AfterEach
Expand Down

0 comments on commit 2775b1d

Please sign in to comment.