Skip to content

Commit

Permalink
Add new unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmadhavig committed Oct 27, 2024
1 parent e102c33 commit e69efc6
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2838,6 +2838,25 @@ public void getSupportedTokenBindingTypes() {
Assert.assertEquals(supportedTokenBindingTypes.size(), 3);
}

@DataProvider(name = "isAppVersionAllowedDataProvider")
public Object[][] isAppVersionAllowedDataProvider() {

return new Object[][]{
{"v0.0.0", "v1.0.0", false},
{"v1.0.0", "v1.0.0", true},
{"v2.0.0", "v1.0.0", true},
{"v0.0.0", "v2.0.0", false},
{"v1.0.0", "v2.0.0", false},
{"v2.0.0", "v2.0.0", true},
};
}

@Test(dataProvider = "isAppVersionAllowedDataProvider")
public void testIsAppVersionAllowed(String appVersion, String allowedVersions, boolean expected) {

assertEquals(OAuth2Util.isAppVersionAllowed(appVersion, allowedVersions), expected);
}

private void setPrivateField(Object object, String fieldName, Object value) throws Exception {

Field field = object.getClass().getDeclaredField(fieldName);
Expand Down

0 comments on commit e69efc6

Please sign in to comment.