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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.SoftwareProperties;
import com.azure.resourcemanager.security.models.EndOfSupportStatus;
import org.junit.jupiter.api.Assertions;

public final class SoftwarePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SoftwareProperties model =
            BinaryData
                .fromString(
                    "{\"deviceId\":\"taoypnyghshxc\",\"osPlatform\":\"hkgmnsg\",\"vendor\":\"xycphdrwjjkh\",\"softwareName\":\"omacluzvxnqmhr\",\"version\":\"pd\",\"endOfSupportStatus\":\"upcomingVersionNoLongerSupported\",\"endOfSupportDate\":\"oi\",\"numberOfKnownVulnerabilities\":785692524,\"firstSeenAt\":\"sffxui\"}")
                .toObject(SoftwareProperties.class);
        Assertions.assertEquals("taoypnyghshxc", model.deviceId());
        Assertions.assertEquals("hkgmnsg", model.osPlatform());
        Assertions.assertEquals("xycphdrwjjkh", model.vendor());
        Assertions.assertEquals("omacluzvxnqmhr", model.softwareName());
        Assertions.assertEquals("pd", model.version());
        Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus());
        Assertions.assertEquals("oi", model.endOfSupportDate());
        Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities());
        Assertions.assertEquals("sffxui", model.firstSeenAt());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SoftwareProperties model =
            new SoftwareProperties()
                .withDeviceId("taoypnyghshxc")
                .withOsPlatform("hkgmnsg")
                .withVendor("xycphdrwjjkh")
                .withSoftwareName("omacluzvxnqmhr")
                .withVersion("pd")
                .withEndOfSupportStatus(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED)
                .withEndOfSupportDate("oi")
                .withNumberOfKnownVulnerabilities(785692524)
                .withFirstSeenAt("sffxui");
        model = BinaryData.fromObject(model).toObject(SoftwareProperties.class);
        Assertions.assertEquals("taoypnyghshxc", model.deviceId());
        Assertions.assertEquals("hkgmnsg", model.osPlatform());
        Assertions.assertEquals("xycphdrwjjkh", model.vendor());
        Assertions.assertEquals("omacluzvxnqmhr", model.softwareName());
        Assertions.assertEquals("pd", model.version());
        Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus());
        Assertions.assertEquals("oi", model.endOfSupportDate());
        Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities());
        Assertions.assertEquals("sffxui", model.firstSeenAt());
    }
}
