// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.attestation.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.attestation.fluent.models.StatusResult;
import com.azure.resourcemanager.attestation.models.AttestationServiceStatus;
import org.junit.jupiter.api.Assertions;

public final class StatusResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StatusResult model =
            BinaryData
                .fromString(
                    "{\"trustModel\":\"vyq\",\"status\":\"Ready\",\"attestUri\":\"ybrk\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Creating\"},\"id\":\"rtfw\",\"name\":\"ukxgaud\",\"type\":\"cs\"},{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"nyejhkryhtnap\",\"name\":\"zw\",\"type\":\"okjye\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"ipjoxzjnchgejs\",\"name\":\"odmailzyd\",\"type\":\"h\"}]}")
                .toObject(StatusResult.class);
        Assertions.assertEquals("vyq", model.trustModel());
        Assertions.assertEquals(AttestationServiceStatus.READY, model.status());
        Assertions.assertEquals("ybrk", model.attestUri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StatusResult model =
            new StatusResult().withTrustModel("vyq").withStatus(AttestationServiceStatus.READY).withAttestUri("ybrk");
        model = BinaryData.fromObject(model).toObject(StatusResult.class);
        Assertions.assertEquals("vyq", model.trustModel());
        Assertions.assertEquals(AttestationServiceStatus.READY, model.status());
        Assertions.assertEquals("ybrk", model.attestUri());
    }
}
