forked from opensearch-project/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrey Pleskach <ples@aiven.io>
- Loading branch information
1 parent
e9d4f0a
commit 044e516
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
38 changes: 38 additions & 0 deletions
38
src/test/java/org/opensearch/security/ssl/config/CertificateTest.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,38 @@ | ||
/* | ||
* 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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.security.ssl.config; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.hamcrest.CoreMatchers.notNullValue; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.junit.Assert.fail; | ||
|
||
public class CertificateTest { | ||
|
||
@Test | ||
public void testGetObjectMethod() { | ||
try { | ||
final Method method = Certificate.getObjectMethod(); | ||
assertThat("Method should not be null", method, notNullValue()); | ||
assertThat( | ||
"One of the expected methods should be available", | ||
method.getName().equals("getBaseObject") || method.getName().equals("getObject") | ||
); | ||
} catch (ClassNotFoundException | NoSuchMethodException e) { | ||
fail("Exception should not be thrown: " + e.getMessage()); | ||
} | ||
} | ||
|
||
} |