diff --git a/components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/util/OAuth2UtilTest.java b/components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/util/OAuth2UtilTest.java index e2fb35e256e..8ee514e70d0 100644 --- a/components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/util/OAuth2UtilTest.java +++ b/components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/util/OAuth2UtilTest.java @@ -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);