Search in sources :

Example 1 with Status

use of fi.thl.covid19.exposurenotification.diagnosiskey.v1.Status in project core by authzforce.

the class BaseXacmlJsonResultPostprocessor method processClientError.

@Override
public JSONObject processClientError(final IndeterminateEvaluationException error) {
    assert maxDepthOfErrorCauseIncludedInResult == 0;
    final Status finalStatus = error.getTopLevelStatus();
    // FIXME: maxDepthOfErrorCauseIncludedInResult > 0 not supported so far
    final JSONObject result = new JSONObject(HashCollections.newImmutableMap("Decision", DecisionType.INDETERMINATE.value(), "Status", toJson(finalStatus)));
    return new JSONObject(HashCollections.newImmutableMap("Response", new JSONArray(Collections.singleton(result))));
}
Also used : Status(oasis.names.tc.xacml._3_0.core.schema.wd_17.Status) JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray)

Example 2 with Status

use of fi.thl.covid19.exposurenotification.diagnosiskey.v1.Status in project yakc by manusa.

the class ServiceLegacyIT method deleteNamespacedService.

@Test
@DisplayName("deleteNamespacedService, should delete existing Service")
void deleteNamespacedService() throws IOException {
    // When
    // Apparently they have corrected this in the API, it will have different results depending on the target cluster
    final Status result = KC.create(CoreV1Api.class).deleteNamespacedService(serviceName, NAMESPACE).get(Status.class);
    // Then
    assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 3 with Status

use of fi.thl.covid19.exposurenotification.diagnosiskey.v1.Status in project yakc by manusa.

the class DeploymentIT method deleteNamespacedDeployment.

@Test
@DisplayName("deleteNamespacedDeployment, should delete existing Pod")
void deleteNamespacedDeployment() throws IOException {
    // When
    final Status result = KC.create(AppsV1Api.class).deleteNamespacedDeployment(deploymentName, NAMESPACE).get();
    // Then
    assertThat(result).isNotNull().hasFieldOrPropertyWithValue("status", "Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with Status

use of fi.thl.covid19.exposurenotification.diagnosiskey.v1.Status in project yakc by manusa.

the class NetworkPolicyIT method deleteNamespacedNetworkPolicy.

@Test
@DisplayName("deleteNamespacedNetworkPolicy, should delete existing NetworkPolicy")
void deleteNamespacedNetworkPolicy() throws IOException {
    // When
    final Status result = KC.create(NetworkingV1Api.class).deleteNamespacedNetworkPolicy(networkPolicyName, NAMESPACE, DeleteOptions.builder().gracePeriodSeconds(1).build()).get();
    // Then
    assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 5 with Status

use of fi.thl.covid19.exposurenotification.diagnosiskey.v1.Status in project yakc by manusa.

the class NetworkingV1IngressIT method deleteNamespacedIngress.

@Test
@DisplayName("deleteNamespacedIngress, should delete existing Ingress")
void deleteNamespacedIngress() throws IOException {
    // When
    final Status result = deleteIngressForTest();
    // Then
    assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Status (com.microsoft.z3.Status)63 BoolExpr (com.microsoft.z3.BoolExpr)55 Test (org.junit.Test)49 Test (org.junit.jupiter.api.Test)20 Expr (com.microsoft.z3.Expr)10 IOException (java.io.IOException)10 JsonMapper.convertObjectToJsonString (com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString)9 RandomDataGenerator.generateRandomAlphabeticString (com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString)9 Status (com.arbindo.mimock.manage.mimocks.models.v1.Status)9 Context (com.microsoft.z3.Context)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)9 Pageable (org.springframework.data.domain.Pageable)9 HttpStatus (org.springframework.http.HttpStatus)9 MvcResult (org.springframework.test.web.servlet.MvcResult)9 Mock (com.arbindo.mimock.entities.Mock)8 List (java.util.List)7 Solver (com.microsoft.z3.Solver)6 PageImpl (org.springframework.data.domain.PageImpl)6