Skip to content

Commit

Permalink
add bearer auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
kota65535 committed Nov 15, 2023
1 parent e6452fd commit 03e12da
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package org.openapitools.client.api;

import org.junit.Assert;
import org.junit.Test;
import org.junit.Ignore;

Expand Down Expand Up @@ -58,10 +59,14 @@ public void testAuthHttpBasicTest() {
*/
@Test
public void testAuthHttpBearerTest() {
String response;
api.getApiClient().setBearerToken("fixed token");
response = api.testAuthHttpBearer();
Assert.assertTrue(response.contains("Authorization: Bearer fixed token"));

String response = api.testAuthHttpBearer();

// TODO: test validations
api.getApiClient().setBearerToken(() -> "dynamic token");
response = api.testAuthHttpBearer();
Assert.assertTrue(response.contains("Authorization: Bearer dynamic token"));
}

}

0 comments on commit 03e12da

Please sign in to comment.