/*
 * ******************************************************************************
 *    Copyright 2016-2017 Spectra Logic Corporation. All Rights Reserved.
 *    Licensed under the Apache License, Version 2.0 (the "License"). You may not use
 *    this file except in compliance with the License. A copy of the License is located at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *    or in the "license" file accompanying this file.
 *    This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *    CONDITIONS OF ANY KIND, either express or implied. See the License for the
 *    specific language governing permissions and limitations under the License.
 * ******************************************************************************
 */

package com.spectralogic.dsbrowser.gui.services;

import org.junit.Test;

import java.time.LocalDateTime;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;

public class BuildInfoService_Test {

    @Test
    public void parseDateString() {
        final String buildDate = "Wed Mar 15 11:10:25 MDT 2017";
        final LocalDateTime ldt = LocalDateTime.parse(buildDate, BuildInfoServiceImpl.dtf);
        final String formattedDate = ldt.format(BuildInfoServiceImpl.dtf);
        //final String formattedDate = ldt.format(BuildInfoServiceImpl.dtf);
        assertThat(formattedDate, is(buildDate));
    }
}

/*
 * ******************************************************************************
 *    Copyright 2016-2017 Spectra Logic Corporation. All Rights Reserved.
 *    Licensed under the Apache License, Version 2.0 (the "License"). You may not use
 *    this file except in compliance with the License. A copy of the License is located at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *    or in the "license" file accompanying this file.
 *    This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *    CONDITIONS OF ANY KIND, either express or implied. See the License for the
 *    specific language governing permissions and limitations under the License.
 * ******************************************************************************
 */

package com.spectralogic.dsbrowser.gui.services;

import org.junit.Test;

import java.time.LocalDateTime;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;

public class BuildInfoService_Test {

    @Test
    public void parseDateString() {
        final String buildDate = "Wed Mar 15 11:10:25 MDT 2017";
        final LocalDateTime ldt = LocalDateTime.parse(buildDate, BuildInfoServiceImpl.dtf);
        assertThat(ldt.toString(), is("2017-03-15T11:10:25"));
    }
}

Convert LocalDateTime expected output to ISO-8601, since there's no timezone in LocalDateTime
Convert LocalDateTime expected output to ISO-8601, since there's no timezone in LocalDateTime
