代码调整
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.Test;
|
||||
@@ -24,20 +26,18 @@ public class AuthTest extends BaseJunitTest {
|
||||
@SneakyThrows
|
||||
@Test
|
||||
public void test(){
|
||||
// tokenEndpoint. &client_id=njcn&client_secret=njcnpqs oAuth2AccessToken
|
||||
System.out.println("hello");
|
||||
String userUrl = "http://127.0.0.1:10214/oauth/token";
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(userUrl)
|
||||
.queryParam("grant_type", "password")
|
||||
.queryParam("client_id", "njcn")
|
||||
.queryParam("client_id", "njcn_app")
|
||||
.queryParam("client_secret", "njcnpqs")
|
||||
.queryParam("username", "root")
|
||||
.queryParam("password", "@#001njcnpqs");
|
||||
URI uri = builder.build().encode().toUri();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("","");
|
||||
|
||||
ResponseEntity<OAuth2AccessToken> userEntity = RestTemplateUtil.post(uri, OAuth2AccessToken.class);
|
||||
|
||||
System.out.println(1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user