package com.its.app;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.its.pis.PisCommServerApplication;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest(classes = PisCommServerApplication.class)
public class PisCommServerApplicationTests {

    private ObjectMapper mapper;
    @Test
    void test1() {
        // Class to Json String
        this.mapper = new ObjectMapper();
        //String message = this.mapper.writeValueAsString(bisMessage);

        // Json String to Class
        //CpuNodeStatusDTO status = this.mapper.readValue(message, CpuNodeStatusDTO.class);

        double sped1 = 14.3;
        double sped2 = 14.9;

        log.info("SPED1: {}, {}, {}, {}", sped1, (int)sped1, String.valueOf(sped1), String.valueOf(Math.round(sped1)));
        log.info("SPED2: {}, {}, {}, {}", sped2, (int)sped2, String.valueOf(sped2), String.valueOf(Math.round(sped2)));

    }

}
