-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic unit tests for the FeatureFlags utility class
Signed-off-by: Kartik Ganesh <[email protected]>
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |