File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
src/main/java/com/github/tomakehurst/wiremock Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,11 @@ public GetGlobalSettingsResult getGlobalSettings() {
432432 adminRoutes .requestSpecForTask (GetGlobalSettingsTask .class ), GetGlobalSettingsResult .class );
433433 }
434434
435+ @ Override
436+ public boolean isHealthy () {
437+ return executeRequest (adminRoutes .requestSpecForTask (HealthCheckTask .class ), Boolean .class );
438+ }
439+
435440 public int port () {
436441 return port ;
437442 }
Original file line number Diff line number Diff line change 2828import com .github .tomakehurst .wiremock .verification .*;
2929import java .util .UUID ;
3030
31- public interface Admin {
31+ public interface Admin extends HealthChecker {
3232
3333 void addStubMapping (StubMapping stubMapping );
3434
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2023 Thomas Akehurst
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package com .github .tomakehurst .wiremock .core ;
17+
18+ public interface HealthChecker {
19+ default boolean isHealthy () {
20+ return true ;
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments