Skip to content

Commit

Permalink
Fixing style
Browse files Browse the repository at this point in the history
Signed-off-by: TrungBui59 <[email protected]>
  • Loading branch information
TrungBui59 committed Nov 5, 2023
1 parent 7fd0dac commit fa06a2e
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void setUp() {
MockitoAnnotations.openMocks(this);
}

public void invokeRemoteModel_SuccessPath(String httpMethod) {
public void invokeRemoteModelSuccessPath(String httpMethod) {
try {
ConnectorAction predictAction = ConnectorAction.builder()
.actionType(ConnectorAction.ActionType.PREDICT)
Expand Down Expand Up @@ -95,7 +95,7 @@ public void invokeRemoteModel_SuccessPath(String httpMethod) {
}
}

public void invokeRemoteModel_HeaderTest(Map<String, String> header) throws ClientProtocolException, IOException {
public void invokeRemoteModelHeaderTest(Map<String, String> header) throws ClientProtocolException, IOException {
ConnectorAction predictAction = ConnectorAction.builder()
.actionType(ConnectorAction.ActionType.PREDICT)
.method("GET")
Expand Down Expand Up @@ -137,29 +137,29 @@ public void invokeRemoteModel_HeaderTest(Map<String, String> header) throws Clie
}
}
@Test
public void invokeRemoteModel_GETMethodSuccessPath() {
invokeRemoteModel_SuccessPath("GET");
public void invokeRemoteModelGETMethodSuccessPath() {
invokeRemoteModelSuccessPath("GET");
}
@Test
public void invokeRemoteModel_POSTMethodSuccessPath() {
invokeRemoteModel_SuccessPath("POST");
public void invokeRemoteModelPOSTMethodSuccessPath() {
invokeRemoteModelSuccessPath("POST");
}

@Test
public void invokeRemoteModel_HeaderNull() throws ClientProtocolException, IOException {
invokeRemoteModel_HeaderTest(null);
public void invokeRemoteModelHeaderNull() throws ClientProtocolException, IOException {
invokeRemoteModelHeaderTest(null);
}

@Test
public void invokeRemoteModel_HeaderNotNull() throws ClientProtocolException, IOException {
public void invokeRemoteModelHeaderNotNull() throws ClientProtocolException, IOException {
Map<String, String> headers = new HashMap<>();
headers.put("api_key", "${credential.key}");
headers.put("Content-type", "application/json");
invokeRemoteModel_HeaderTest(headers);
invokeRemoteModelHeaderTest(headers);
}

@Test
public void invokeRemoteModel_POSTMethodErrorPath() {
public void invokeRemoteModelPOSTMethodErrorPath() {
exceptionRule.expect(MLException.class);
exceptionRule.expectMessage("Failed to create http request for remote model");

Expand All @@ -179,7 +179,7 @@ public void invokeRemoteModel_POSTMethodErrorPath() {
}

@Test
public void invokeRemoteModel_GETMethodErrorPath() {
public void invokeRemoteModelGETMethodErrorPath() {
exceptionRule.expect(MLException.class);
exceptionRule.expectMessage("Failed to create http request for remote model");

Expand All @@ -200,7 +200,7 @@ public void invokeRemoteModel_GETMethodErrorPath() {
}

@Test
public void invokeRemoteModel_WrongHttpMethod() {
public void invokeRemoteModelWrongHttpMethod() {
exceptionRule.expect(IllegalArgumentException.class);
exceptionRule.expectMessage("unsupported http method");
ConnectorAction predictAction = ConnectorAction.builder()
Expand All @@ -220,7 +220,7 @@ public void invokeRemoteModel_WrongHttpMethod() {
}

@Test
public void executePredict_RemoteInferenceInput() throws IOException {
public void executePredictRemoteInferenceInput() throws IOException {
ConnectorAction predictAction = ConnectorAction.builder()
.actionType(ConnectorAction.ActionType.PREDICT)
.method("POST")
Expand All @@ -242,7 +242,7 @@ public void executePredict_RemoteInferenceInput() throws IOException {
}

@Test
public void executePredict_TextDocsInput_NoPreprocessFunction() throws IOException {
public void executePredictTextDocsInputNoPreprocessFunction() throws IOException {
ConnectorAction predictAction = ConnectorAction.builder()
.actionType(ConnectorAction.ActionType.PREDICT)
.method("POST")
Expand All @@ -264,7 +264,7 @@ public void executePredict_TextDocsInput_NoPreprocessFunction() throws IOExcepti
}

@Test
public void executePredict_TextDocsInput() throws IOException {
public void executePredictTextDocsInput() throws IOException {
String preprocessResult1 = "{\"parameters\": { \"input\": \"test doc1\" } }";
String preprocessResult2 = "{\"parameters\": { \"input\": \"test doc2\" } }";
when(scriptService.compile(any(), any()))
Expand Down

0 comments on commit fa06a2e

Please sign in to comment.