Basic auth migrating to OAuth accessToken is not working when it's replace

oauth2

#1

Here is my code using basic auth and it’s working perfectly by getting response…

Client client = ClientBuilder.newClient();
String auth = new String(Base64.getEncoder().encode(username.concat(":").concat(password).getBytes()));
WebTarget webTarget = client.target(“https://xxxxxxxxxxxxxx.com/rest/api/2/issue/TES-63”);
response = webTarget.request().header(“Authorization”, "Basic " + auth).accept(“application/json”).get();

Migrating basic auth to OAuth and here is my code which is getting Unauthorized. any suggestions please…
Client client = ClientBuilder.newClient();
WebTarget webTarget = client.target(“https://xxxxxxxxxxxxxx.com/rest/api/2/issue/TES-63”);
response = webTarget.request().header(“Authorization”, “Bearer” + accessToken).accept(“application/json”).get();