Skip to content

Commit

Permalink
Added basic unit tests for the FeatureFlags utility class
Browse files Browse the repository at this point in the history
Signed-off-by: Kartik Ganesh <[email protected]>
  • Loading branch information
kartg committed Apr 22, 2022
1 parent 25901f4 commit e5c27c9
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.common.util;

import org.opensearch.test.OpenSearchTestCase;

public class FeatureFlagTests extends OpenSearchTestCase {

public void testMissingFeatureFlag() {
String testFlag = "missingFeatureFlag";
assertNull(System.getProperty(testFlag));
assertFalse(FeatureFlags.isEnabled(testFlag));
}

public void testNonBooleanFeatureFlag() {
String javaVersionProperty = "java.version";
assertNotNull(System.getProperty(javaVersionProperty));
assertFalse(FeatureFlags.isEnabled(javaVersionProperty));
}
}

0 comments on commit e5c27c9

Please sign in to comment.