diff --git a/src/main/java/ai/philterd/philter/PhilterClient.java b/src/main/java/ai/philterd/philter/PhilterClient.java index aad8d0b..8f58fc4 100644 --- a/src/main/java/ai/philterd/philter/PhilterClient.java +++ b/src/main/java/ai/philterd/philter/PhilterClient.java @@ -295,12 +295,12 @@ public List replacements(String documentId) throws IOException { /** * Gets the status of Philter. - * @return A {@link StatusResponse} object. + * @return A string containing the status of Philter. * @throws IOException Thrown if the request can not be completed. */ - public StatusResponse status() throws IOException { + public String status() throws IOException { - final Response response = service.status().execute(); + final Response response = service.status().execute(); if(response.isSuccessful()) { diff --git a/src/main/java/ai/philterd/philter/model/StatusResponse.java b/src/main/java/ai/philterd/philter/model/StatusResponse.java deleted file mode 100644 index 5ee6570..0000000 --- a/src/main/java/ai/philterd/philter/model/StatusResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright 2023 Philterd, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy - * of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - ******************************************************************************/ -package ai.philterd.philter.model; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -/** - * The status of Philter. - */ -public class StatusResponse { - - @Expose - @SerializedName("status") - private String status; - - @Expose - @SerializedName("version") - private String version; - - @Expose - @SerializedName("lens") - private String lens; - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getLens() { - return lens; - } - - public void setLens(String lens) { - this.lens = lens; - } - -} diff --git a/src/main/java/ai/philterd/philter/services/PhilterService.java b/src/main/java/ai/philterd/philter/services/PhilterService.java index 3d94b41..a22763e 100644 --- a/src/main/java/ai/philterd/philter/services/PhilterService.java +++ b/src/main/java/ai/philterd/philter/services/PhilterService.java @@ -18,7 +18,6 @@ import ai.philterd.philter.model.Alert; import ai.philterd.philter.model.FilteredSpan; import ai.philterd.philter.model.ExplainResponse; -import ai.philterd.philter.model.StatusResponse; import okhttp3.RequestBody; import okhttp3.ResponseBody; import retrofit2.Call; @@ -49,7 +48,7 @@ public interface PhilterService { // Status @GET("/api/status") - Call status(); + Call status(); // Filter Profiles diff --git a/src/test/java/com/mtnfog/test/philter/PhilterClientTest.java b/src/test/java/com/mtnfog/test/philter/PhilterClientTest.java index df9cdcd..41e0418 100644 --- a/src/test/java/com/mtnfog/test/philter/PhilterClientTest.java +++ b/src/test/java/com/mtnfog/test/philter/PhilterClientTest.java @@ -17,12 +17,10 @@ import ai.philterd.philter.PhilterClient; import ai.philterd.philter.model.BinaryFilterResponse; -import ai.philterd.philter.model.StatusResponse; import okhttp3.ConnectionPool; import okhttp3.OkHttpClient; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Assert; @@ -158,9 +156,9 @@ public void status() throws Exception { .withOkHttpClientBuilder(getUnsafeOkHttpClientBuilder()) .build(); - final StatusResponse statusResponse = client.status(); + final String status = client.status(); - Assert.assertTrue(StringUtils.equals("Healthy", statusResponse.getStatus())); + Assert.assertTrue(status.startsWith("Healhty:")); }