{"id":78808,"date":"2020-09-20T16:33:18","date_gmt":"2020-09-20T16:33:18","guid":{"rendered":"https:\/\/www.baeldung.com\/?p=87393"},"modified":"2020-09-20T16:33:18","modified_gmt":"2020-09-20T16:33:18","slug":"guide-to-the-system-rules-library","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2020\/09\/20\/guide-to-the-system-rules-library\/","title":{"rendered":"Guide to the System Rules Library"},"content":{"rendered":"<p class=\"syndicated-attribution\"><meta name= \\\"keywords \\\" content= \\\"\u96fb\u5b50\u8a08\u7b97\u6a5f, \u6559\u80b2, IT \u96fb\u8166\u73ed,\u96fb\u8166\u88dc\u7fd2\uff0c \u96fb\u8166\u73ed\uff0c \u5bb6\u6559\uff0c \u79c1\u4eba\u8001\u5e2b\uff0c \u8cc7\u8a0a\u6280\u8853\uff0c \u7a0b\u5e8f\u8a2d\u8a08\uff0c \u96fb\u5b50\u8a08\u7b97\u6a5f\uff0c \u904a\u6232\uff0c \u860b\u679c\uff0c \u96fb\u5f71\uff0c \u8a08\u7b97\u6a5f\uff0c\u7de8\u78bc\uff0c Java\uff0c C\/C++\uff0c JavaScript\uff0c PHP\uff0c HTML\uff0c CSS\uff0c MySQL\uff0c mobile\uff0c Android\uff0c \u52d5\u6f2b\uff0c Python\uff0c teacher\uff0c \u88dc\u7fd2\uff0c \u96fb\u8166\u88dc\u7fd2 \u8cc7\u8a0a, \u7535\u5b50\u8ba1\u7b97\u673a, IT ,Game, apple, movie, Computer,student,Java,\u6559\u80b2, ,\u5b66\u751f, \u5b66\u4e60, learn, \u6559\u5b66,  Android, apple,anime, animation, \u4fe1\u606f\u6280\u672f, \u7a0b\u5e8f\u8bbe\u8ba1, \u79fb\u52a8\u7535\u8bdd, \u8cc7\u8a0a\u79d1\u6280,Game, Jeu, Juego,Call Of Duty ,\u4f7f\u547d\u53ec\u559a , \u6e38\u620f, \u7535\u5b50\u6e38\u620f,, \u591a\u4eba\u7535\u5b50\u6e38\u620f, \u7f51\u7edc\u6e38\u620f\uff0conline\uff0conline game, \u624b\u673a\u6e38\u620f, mobile \\\"><\/p>\n<h2 data-id=\"overview\">1. Overview<\/h2>\n<div class=\"bd-anchor\" id=\"overview\"><\/div>\n<p>Sometimes when writing unit tests, we may need to test code that interacts directly with the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-lang-system\"><em>System<\/em><\/a> class. Typically in applications such as command-line tools which call <em><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-system-exit\">System.exit<\/a><\/em> directly or read arguments using <em>System.in<\/em>.<\/p>\n<p>In this tutorial, <strong>we&#8217;ll take a look at the most common features of a neat external library called <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/stefanbirkner.github.io\/system-rules\/\">System Rules<\/a> which provides a set of <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/junit-4-rules\">JUnit rules<\/a> for testing code that uses the <em>System<\/em> class<\/strong>.<\/p>\n<h2 data-id=\"maven-dependencies\">2. Maven Dependencies<\/h2>\n<div class=\"bd-anchor\" id=\"maven-dependencies\"><\/div>\n<p>First, let\u2019s add the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/search.maven.org\/classic\/#search%7Cga%7C1%7Ca%3A%22system-rules%22\">System Rules dependency<\/a> to our <em>pom.xml<\/em>:<\/p>\n<pre><code class=\"language-xml\">&lt;dependency&gt;\r\n    &lt;groupId&gt;com.github.stefanbirkner&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;system-rules&lt;\/artifactId&gt;\r\n    &lt;version&gt;1.19.0&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<p>We&#8217;ll also add <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/github.com\/stefanbirkner\/system-lambda\">System Lambda<\/a> dependency which is available from <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/search.maven.org\/classic\/#search%7Cga%7C1%7Ca%3A%22system-lambda%22\">Maven Central<\/a> as well:<\/p>\n<pre><code class=\"language-xml\">&lt;dependency&gt;\r\n    &lt;groupId&gt;com.github.stefanbirkner&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;system-lambda&lt;\/artifactId&gt;\r\n    &lt;version&gt;1.1.0&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<p><strong>The reason for adding this last dependency is so we can also show examples where appropriate using <\/strong><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/junit-5\"><strong>JUnit5<\/strong><\/a>. As we know, in this version of JUnit, the rules model was replaced by <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/junit-5-extensions\">extensions<\/a>.<\/p>\n<h2 data-id=\"working-with-system-properties\">3. Working With System Properties<\/h2>\n<div class=\"bd-anchor\" id=\"working-with-system-properties\"><\/div>\n<p>To quickly recap, the Java platform uses a <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-properties\"><em>Properties<\/em> object<\/a> to provide information about the local system and configuration. We can easily print out the properties:<\/p>\n<pre><code class=\"language-java\">System.getProperties()\r\n  .forEach((key, value) -&gt; System.out.println(key + \": \" + value));<\/code><\/pre>\n<p>As we can see, properties include information such as the current user, the current version of the Java runtime, and file path-name separator:<\/p>\n<pre><code class=\"language-plaintext\">java.version: 1.8.0_221\r\nfile.separator: \/\r\nuser.home: \/Users\/baeldung\r\nos.name: Mac OS X\r\n...<\/code><\/pre>\n<p>We can also set our own system properties by using the <em>System.setProperty<\/em> method. Care should be taken when working with system properties from our tests, as these properties are JVM-global.<\/p>\n<p>For example, if we set a system property, we should ensure we restore the property to its original value when our test finishes or if a failure occurs. This can sometimes lead to cumbersome setup and tear down code. <strong>However, if we neglect to do this, it could lead to unexpected side-effects in our tests.<\/strong><\/p>\n<p>In the next section, we&#8217;ll see how we can provide, clean, and make sure we restore system property values after our tests complete in a concise and simple manner.<\/p>\n<h2 data-id=\"providing-system-properties\">4. Providing System Properties<\/h2>\n<div class=\"bd-anchor\" id=\"providing-system-properties\"><\/div>\n<p>Let&#8217;s imagine that we have a system property <em>log_dir <\/em>which contains the location of where our logs should be written and our application sets this location when it starts up:<\/p>\n<pre><code class=\"language-java\">System.setProperty(\"log_dir\", \"\/tmp\/baeldung\/logs\");<\/code><\/pre>\n<h3 data-id=\"1-provide-a-single-property\">4.1. Provide a Single Property<\/h3>\n<div class=\"bd-anchor\" id=\"1-provide-a-single-property\"><\/div>\n<p>Now let&#8217;s consider that from our unit test, we want to provide a different value. We can do this using the <em>ProvideSystemProperty<\/em> rule:<\/p>\n<pre><code class=\"language-java\">public class ProvidesSystemPropertyWithRuleUnitTest {\r\n    @Rule\r\n    public final ProvideSystemProperty providesSystemPropertyRule = new ProvideSystemProperty(\"log_dir\", \"test\/resources\");\r\n    @Test\r\n    public void givenProvideSystemProperty_whenGetLogDir_thenLogDirIsProvidedSuccessfully() {\r\n        assertEquals(\"log_dir should be provided\", \"test\/resources\", System.getProperty(\"log_dir\"));\r\n    }\r\n    \/\/ unit test definition continues\r\n}\r\n<\/code><\/pre>\n<p><strong>Using the <em>ProvideSystemProperty<\/em> rule, we can set an arbitrary value for a given system property for use from our tests.<\/strong> In this example, we set the <em>log_dir<\/em> property to our <em>test\/resources<\/em> directory, and from our unit test, simply assert that the test property value has been provided successfully.<\/p>\n<p>If we then print out the value of the <em>log_dir<\/em> property when our test class completes:<\/p>\n<pre><code class=\"language-java\">@AfterClass\r\npublic static void tearDownAfterClass() throws Exception {\r\n    System.out.println(System.getProperty(\"log_dir\"));\r\n}\r\n<\/code><\/pre>\n<p>We can see the value of the property has been restored to its original value:<\/p>\n<pre><code class=\"language-plaintext\">\/tmp\/baeldung\/logs<\/code><\/pre>\n<h3 data-id=\"2-providing-multiple-properties\">4.2. Providing Multiple Properties<\/h3>\n<div class=\"bd-anchor\" id=\"2-providing-multiple-properties\"><\/div>\n<p>If we need to provide multiple properties, we can use the <em>and<\/em> method to chain as many property values together as we require for our test:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final ProvideSystemProperty providesSystemPropertyRule = \r\n    new ProvideSystemProperty(\"log_dir\", \"test\/resources\").and(\"another_property\", \"another_value\")<\/code><\/pre>\n<h3 data-id=\"3-providing-properties-from-a-file\">4.3. Providing Properties From a File<\/h3>\n<div class=\"bd-anchor\" id=\"3-providing-properties-from-a-file\"><\/div>\n<p>Likewise, we also have the possibility of providing properties from a file or classpath resource using the <em>ProvideSystemProperty<\/em> rule:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final ProvideSystemProperty providesSystemPropertyFromFileRule = \r\n  ProvideSystemProperty.fromResource(\"\/test.properties\");\r\n@Test\r\npublic void givenProvideSystemPropertyFromFile_whenGetName_thenNameIsProvidedSuccessfully() {\r\n    assertEquals(\"name should be provided\", \"baeldung\", System.getProperty(\"name\"));\r\n    assertEquals(\"version should be provided\", \"1.0\", System.getProperty(\"version\"));\r\n}<\/code><\/pre>\n<p>In the above example, we assume that we have a <em>test.properties<\/em> file on the classpath:<\/p>\n<pre><code class=\"language-plaintext\">name=baeldung\r\nversion=1.0<\/code><\/pre>\n<h3 data-id=\"4-providing-properties-with-junit5-and-lambdas\">4.4. Providing Properties With JUnit5 and Lambdas<\/h3>\n<div class=\"bd-anchor\" id=\"4-providing-properties-with-junit5-and-lambdas\"><\/div>\n<p>As we previously mentioned, we could also use the System Lamda version of the library to implement tests compatible with JUnit5.<\/p>\n<p>Let&#8217;s see how to implement our test using this version of the library:<\/p>\n<pre><code class=\"language-java\">@BeforeAll\r\nstatic void setUpBeforeClass() throws Exception {\r\n    System.setProperty(\"log_dir\", \"\/tmp\/baeldung\/logs\");\r\n}\r\n@Test\r\nvoid givenSetSystemProperty_whenGetLogDir_thenLogDirIsProvidedSuccessfully() throws Exception {\r\n    restoreSystemProperties(() -&gt; {\r\n        System.setProperty(\"log_dir\", \"test\/resources\");\r\n        assertEquals(\"log_dir should be provided\", \"test\/resources\", System.getProperty(\"log_dir\"));\r\n    });\r\n    assertEquals(\"log_dir should be provided\", \"\/tmp\/baeldung\/logs\", System.getProperty(\"log_dir\"));\r\n}<\/code><\/pre>\n<p>In this version, we can use the <em>restoreSystemProperties<\/em> method to execute a given statement. <strong>Inside this statement, we can set up and provide the values we require for our system properties<\/strong>. As we can see after this method finishes execution, the value of <em>log_dir<\/em> is the same as before <em>\/tmp\/baeldung\/logs<\/em>.<\/p>\n<p>Unfortunately, there is no built-in support for providing properties from files using the <em>restoreSystemProperties <\/em>method.<\/p>\n<h2 data-id=\"clearing-system-properties\">5. Clearing System Properties<\/h2>\n<div class=\"bd-anchor\" id=\"clearing-system-properties\"><\/div>\n<p>Sometimes we might want to clear a set of system properties when our test starts and restore their original values when the test finishes irrespective of whether it passes or fails.<\/p>\n<p>We can use the <em>ClearSystemProperties<\/em> rule for this purpose:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final ClearSystemProperties userNameIsClearedRule = new ClearSystemProperties(\"user.name\");\r\n@Test\r\npublic void givenClearUsernameProperty_whenGetUserName_thenNull() {\r\n    assertNull(System.getProperty(\"user.name\"));\r\n}<\/code><\/pre>\n<p>The system property <em>user.name<\/em> is one of the predefined system properties, which contains the user account name. As expected in the above unit test, we clear this property and check it is empty from our test.<\/p>\n<p><strong>Conveniently, we can also pass multiple property names to the <em>ClearSystemProperties<\/em> constructor.<\/strong><\/p>\n<h2 data-id=\"mocking-systemin\">6. Mocking <em>System.in<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"mocking-systemin\"><\/div>\n<p>From time to time, we might create interactive command-line applications that read from <em>System.in<\/em>.<\/p>\n<p>For this section, we&#8217;ll use a very simple example which reads a first name and surname from the standard input and concatenates them together:<\/p>\n<pre><code class=\"language-java\">private String getFullname() {\r\n    try (Scanner scanner = new Scanner(System.in)) {\r\n        String firstName = scanner.next();\r\n        String surname = scanner.next();\r\n        return String.join(\" \", firstName, surname);\r\n    }\r\n}<\/code><\/pre>\n<p>System Rules contains the <em>TextFromStandardInputStream<\/em> rule which we can use to specify the lines that should be provided when calling <em>System.in<\/em>:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final TextFromStandardInputStream systemInMock = emptyStandardInputStream();\r\n@Test\r\npublic void givenTwoNames_whenSystemInMock_thenNamesJoinedTogether() {\r\n    systemInMock.provideLines(\"Jonathan\", \"Cook\");\r\n    assertEquals(\"Names should be concatenated\", \"Jonathan Cook\", getFullname());\r\n}<\/code><\/pre>\n<p><strong>We accomplish this by using the <em>providesLines<\/em> method, which takes a <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-varargs\">varargs<\/a> parameter to enable specifying more than one value.<\/strong><\/p>\n<p>In this example, we provide two values before calling the <em>getFullname<\/em> method, where <em>System.in<\/em> is referenced. Our two provided line values will be returned each time we call <em>scanner.next()<\/em>.<\/p>\n<p>Let&#8217;s take a look at how we can achieve the same in a JUnit 5 version of the test using System Lambda:<\/p>\n<pre><code class=\"language-java\">@Test\r\nvoid givenTwoNames_whenSystemInMock_thenNamesJoinedTogether() throws Exception {\r\n    withTextFromSystemIn(\"Jonathan\", \"Cook\").execute(() -&gt; {\r\n        assertEquals(\"Names should be concatenated\", \"Jonathan Cook\", getFullname());\r\n    });\r\n}<\/code><\/pre>\n<p><strong>In this variation, we use the similarly named <em>withTextFromSystemIn\u00a0<\/em>method, which lets us specify the provided <em>System.in<\/em> values.<\/strong><\/p>\n<p>It is important to mention in both cases that after the test finishes, the original value of <em>System.in<\/em> will be restored.<\/p>\n<h2 data-id=\"testing-systemout-and-systemerr\">7. Testing <em>System.out<\/em> and <em>System.err<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"testing-systemout-and-systemerr\"><\/div>\n<p>In a previous tutorial, we saw how to use System Rules to unit test <em><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-testing-system-out-println#using-system-rules\">System.out.println()<\/a>.<\/em><\/p>\n<p>Conveniently, we can apply an almost identical approach for testing code which interacts with the standard error stream. This time we use the <em>SystemErrRule<\/em>:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final SystemErrRule systemErrRule = new SystemErrRule().enableLog();\r\n@Test\r\npublic void givenSystemErrRule_whenInvokePrintln_thenLogSuccess() {\r\n    printError(\"An Error occurred Baeldung Readers!!\");\r\n    Assert.assertEquals(\"An Error occurred Baeldung Readers!!\", \r\n      systemErrRule.getLog().trim());\r\n}\r\nprivate void printError(String output) {\r\n    System.err.println(output);\r\n}<\/code><\/pre>\n<p>Nice! Using the <em>SystemErrRule<\/em>, we can intercept the writes to <em>System.err<\/em>. First, we start logging everything written to <em>System.err<\/em> by calling the <em>enableLog<\/em> method on our rule. Then we simply call <em>getLog<\/em> to get the text written to System.err since we called <em>enableLog<\/em>.<\/p>\n<p>Now, let&#8217;s implement the JUnit5 version of our test:<\/p>\n<pre><code class=\"language-java\">@Test\r\nvoid givenTapSystemErr_whenInvokePrintln_thenOutputIsReturnedSuccessfully() throws Exception {\r\n    String text = tapSystemErr(() -&gt; {\r\n        printError(\"An error occurred Baeldung Readers!!\");\r\n    });\r\n    Assert.assertEquals(\"An error occurred Baeldung Readers!!\", text.trim());\r\n}<\/code><\/pre>\n<p>In this version, <strong>we make use of the <em>tapSystemErr<\/em> method, which executes the statement and lets us capture the content passed to <em>System.err<\/em>.<\/strong><\/p>\n<h2 data-id=\"handling-systemexit\">8. Handling <em>System.exit<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"handling-systemexit\"><\/div>\n<p>Command-line applications typically terminate by calling <em>System.exit<\/em>. <strong>If we want to test such an application, it is likely that our test will terminate abnormally before it finishes when it encounters the code which calls <em>System.exit<\/em>.<\/strong><\/p>\n<p>Thankfully, System Rules provides a neat solution to handle this using\u00a0the <em>ExpectedSystemExit<\/em> rule:<\/p>\n<pre><code class=\"language-java\">@Rule\r\npublic final ExpectedSystemExit exitRule = ExpectedSystemExit.none();\r\n@Test\r\npublic void givenSystemExitRule_whenAppCallsSystemExit_thenExitRuleWorkssAsExpected() {\r\n    exitRule.expectSystemExitWithStatus(1);\r\n    exit();\r\n}\r\nprivate void exit() {\r\n    System.exit(1);\r\n}<\/code><\/pre>\n<p>Using the <em>ExpectedSystemExit<\/em> rule allows us to specify from our test the expected <em>System.exit()<\/em> call. In this simple example, we also check the expected status code using the <em>expectSystemExitWithStatus<\/em> method.<\/p>\n<p><strong>We can achieve something similar in our JUnit 5 version using the <em>catchSystemExit<\/em> method<\/strong>:<\/p>\n<pre><code class=\"language-java\">@Test\r\nvoid givenCatchSystemExit_whenAppCallsSystemExit_thenStatusIsReturnedSuccessfully() throws Exception {\r\n    int statusCode = catchSystemExit(() -&gt; {\r\n        exit();\r\n    });\r\n    assertEquals(\"status code should be 1:\", 1, statusCode);\r\n}<\/code><\/pre>\n<h2 data-id=\"conclusion\">9. Conclusion<\/h2>\n<div class=\"bd-anchor\" id=\"conclusion\"><\/div>\n<p>To summarize, in this tutorial, we&#8217;ve explored the System Rules library in detail.<\/p>\n<p>First, we started by explaining how to test code that uses system properties. Then we looked at how to test the standard output and standard input. Finally, we looked at how to handle code which calls<em> System.exit<\/em> from our tests.<\/p>\n<p><strong>The System Rules library also provides support for providing environment variables and special security mangers from our tests<\/strong>. Be sure to check out the full <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/stefanbirkner.github.io\/system-rules\/\">documentation<\/a> for details.<\/p>\n<p>As always, the full source code of the article is available\u00a0<a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/github.com\/eugenp\/tutorials\/tree\/master\/testing-modules\/testing-libraries-2\" rel=\"noopener noreferrer\">over on GitHub<\/a>.<\/p>\n<p>The post <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-system-rules-junit\/\" >Guide to the System Rules Library<\/a> first appeared on <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/\" >Baeldung<\/a>.<\/p>\n<p><Img align=\"left\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" style=\"border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;\" hspace=\"0\" src=\"https:\/\/feeds.feedblitz.com\/~\/i\/635776305\/0\/baeldung\"><\/p>\n<div style=\"clear:both;padding-top:0.2em;\"><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Share on Google+\" href=\"https:\/\/feeds.feedblitz.com\/_\/30\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/googleplus20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/635776305\/baeldung,\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/java-system-rules-junit#respond\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&#160;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/java-system-rules-junit\/feed\/\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>&#160;<\/div>\n\n<p class=\"syndicated-attribution\"><figure class= \\\"wp-block-image alignnone \\\"><img src= \\\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/05\/logo2-2.png\\\" alt=\\\"IT\u96fb\u8166\u88dc\u7fd2 java\u88dc\u7fd2 \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b, PHP\u88dc\u7fd2,CSS\u88dc\u7fd2,XML,Java\u88dc\u7fd2,MySQL\u88dc\u7fd2,graphic design\u88dc\u7fd2,\u4e2d\u5c0f\u5b78ICT\u88dc\u7fd2,\u4e00\u5c0d\u4e00\u79c1\u4eba\u88dc\u7fd2\u548cFreelance\u81ea\u7531\u5de5\u4f5c\u914d\u5c0d\u3002\\\"\/><figcaption>\u7acb\u523b\u8a3b\u518a\u53ca\u5831\u540d\u96fb\u8166\u88dc\u7fd2\u8ab2\u7a0b\u5427!<\/figcaption><\/figure>\r\n<\/br>Find A Teacher Form:\r\n<\/br>https:\/\/docs.google.com\/forms\/d\/1vREBnX5n262umf4wU5U2pyTwvk9O-JrAgblA-wH9GFQ\/viewform?edit_requested=true#responses\r\n<\/br><\/br>Email:\r\n<\/br>public1989two@gmail.com<br><br><br><br><br><br><br>\r\n<a href=www.itsec.hk style=color:#FFFFFF;>www.itsec.hk<\/a><br>\r\n<a href=\\\"www.itsec.vip\\\" style=color:#FFFFFF;>www.itsec.vip<\/a><br>\r\n<a href=\\\"www.itseceu.uk\\\" style=color:#FFFFFF;>www.itseceu.uk<\/a><br><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Explore the System Rules library in detail.<\/p>\n<p>The post <a rel=\"NOFOLLOW noopener noreferrer\" href=\"https:\/\/feeds.feedblitz.com\/~\/635776305\/0\/baeldung~Guide-to-the-System-Rules-Library\/\" target=\"_blank\">Guide to the System Rules Library<\/a> first appeared on <a rel=\"NOFOLLOW noopener noreferrer\" href=\"https:\/\/www.baeldung.com\/\" target=\"_blank\">Baeldung<\/a>.<\/p>\n<div><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\"><\/a>&nbsp;<a title=\"Share on Google+\" href=\"https:\/\/feeds.feedblitz.com\/_\/30\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/googleplus20.png\"><\/a>&nbsp;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/635776305\/baeldung,\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\"><\/a>&nbsp;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\"><\/a>&nbsp;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\"><\/a>&nbsp;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/635776305\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\"><\/a>&nbsp;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/java-system-rules-junit#respond\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&nbsp;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/java-system-rules-junit\/feed\/\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>&nbsp;<\/div>\n<\/div>","protected":false},"author":881,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Guide to the System Rules Library - ITTeacherITFreelance.hk","description":"Explore the System Rules library in detail. The post Guide to the System Rules Library first appeared on Baeldung . &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n"},"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/78808"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/881"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=78808"}],"version-history":[{"count":9,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/78808\/revisions"}],"predecessor-version":[{"id":83112,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/78808\/revisions\/83112"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=78808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=78808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=78808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}