Search in sources :

Example 1 with ProfileStatus

use of io.cdap.cdap.runtime.spi.profile.ProfileStatus in project cdap by caskdata.

the class AppFabricTestBase method getProfileStatus.

protected Optional<ProfileStatus> getProfileStatus(ProfileId profileId, int expectedCode) throws Exception {
    HttpResponse response = doGet(String.format("/v3/namespaces/%s/profiles/%s/status", profileId.getNamespace(), profileId.getProfile()));
    assertResponseCode(expectedCode, response);
    if (expectedCode == HttpResponseStatus.OK.code()) {
        return Optional.of(GSON.fromJson(response.getResponseBodyAsString(), ProfileStatus.class));
    }
    return Optional.empty();
}
Also used : HttpResponse(io.cdap.common.http.HttpResponse) ProfileStatus(io.cdap.cdap.runtime.spi.profile.ProfileStatus)

Aggregations

ProfileStatus (io.cdap.cdap.runtime.spi.profile.ProfileStatus)1 HttpResponse (io.cdap.common.http.HttpResponse)1