forked from opensearch-project/flow-framework
-
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: Amit Galitzky <[email protected]>
- Loading branch information
1 parent
74f58bc
commit 9078d04
Showing
4 changed files
with
103 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
44 changes: 44 additions & 0 deletions
44
src/test/java/org/opensearch/flowframework/common/DefaultUseCasesTests.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,44 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* 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.flowframework.common; | ||
|
||
import org.opensearch.flowframework.exception.FlowFrameworkException; | ||
import org.opensearch.test.OpenSearchTestCase; | ||
|
||
public class DefaultUseCasesTests extends OpenSearchTestCase { | ||
|
||
@Override | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
public void testGetDefaultsFileByValidUseCaseName() throws FlowFrameworkException { | ||
String defaultsFile = DefaultUseCases.getDefaultsFileByUseCaseName("open_ai_embedding_model_deploy"); | ||
assertEquals("defaults/open-ai-embedding-defaults.json", defaultsFile); | ||
} | ||
|
||
public void testGetDefaultsFileByInvalidUseCaseName() throws FlowFrameworkException { | ||
FlowFrameworkException e = assertThrows( | ||
FlowFrameworkException.class, | ||
() -> DefaultUseCases.getDefaultsFileByUseCaseName("invalid_use_case") | ||
); | ||
} | ||
|
||
public void testGetSubstitutionTemplateByValidUseCaseName() throws FlowFrameworkException { | ||
String templateFile = DefaultUseCases.getSubstitutionReadyFileByUseCaseName("open_ai_embedding_model_deploy"); | ||
assertEquals("substitutionTemplates/deploy-remote-model-template.json", templateFile); | ||
} | ||
|
||
public void testGetSubstitutionTemplateByInvalidUseCaseName() throws FlowFrameworkException { | ||
FlowFrameworkException e = assertThrows( | ||
FlowFrameworkException.class, | ||
() -> DefaultUseCases.getSubstitutionReadyFileByUseCaseName("invalid_use_case") | ||
); | ||
} | ||
} |
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