BAEL-1534: Detect the OS from Java (#3636)
* BAEL-1534: Mini-article completed. * BAEL-1534: Changes incorporated. * BAEL-1534: Changes incorporated. * BAEL-1534: Changes incorporated. * BAEL-1534: Changes incorporated.
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
487864a2f2
commit
1f27c9ded7
@@ -0,0 +1,25 @@
|
||||
package com.baeldung.system;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore
|
||||
public class WhenDetectingOSTest {
|
||||
|
||||
private DetectOS os = new DetectOS();
|
||||
|
||||
@Test
|
||||
public void whenUsingSystemProperty_shouldReturnOS() {
|
||||
String expected = "Windows 10";
|
||||
String actual = os.getOperatingSystem();
|
||||
Assert.assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenUsingSystemUtils_shouldReturnOS() {
|
||||
String expected = "Windows 10";
|
||||
String actual = os.getOperatingSystemSystemUtils();
|
||||
Assert.assertEquals(expected, actual);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user