{"id":30,"date":"2021-03-14T23:28:13","date_gmt":"2021-03-14T16:28:13","guid":{"rendered":"https:\/\/www.rnikonorov.ru\/?p=30"},"modified":"2021-03-15T02:01:41","modified_gmt":"2021-03-14T19:01:41","slug":"%d0%bf%d0%b8%d1%88%d0%b5%d0%bc-unit-%d1%82%d0%b5%d1%81%d1%82%d1%8b-%d0%bc%d0%be%d0%ba%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-mocking","status":"publish","type":"post","link":"https:\/\/www.rnikonorov.ru\/?p=30","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c unit-\u0442\u0435\u0441\u0442\u044b. \u041c\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (mocking)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0440\u0443\u043a\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0441 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u041d\u0435 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0438\u0441\u0430\u043b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0410 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u043f\u043e\u0438\u0437\u0443\u0447\u0430\u0442\u044c. \u041e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0438\u043a\u043b \ud83d\ude42<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0447\u043d\u0443 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c.\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0448\u044c\u044e JUnit, EasyMock \u0438 PowerMock. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f, \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0438 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u043e\u0432. <a href=\"https:\/\/www.rnikonorov.ru\/?p=32\">\u0412\u0442\u043e\u0440\u0430\u044f&nbsp;\u0441\u0442\u0430\u0442\u044c\u044f \u0446\u0438\u043a\u043b\u0430<\/a> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0436\u0435 \u0442\u0435\u0441\u0442, \u043d\u043e \u0441 testng,&nbsp; \u0430 \u043d\u0435 \u0441 JUnit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0432\u044b\u0441\u043e\u0441\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0430\u043b\u044c\u0446\u0430, \u043d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e: \u0435\u0441\u0442\u044c API <strong>AuthInterface<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 <strong>doAuth(String user, String password)<\/strong>. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0435\u043a\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c InnerInterfaceImpl. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 authUser:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>public boolean doAuth(final String userName, final String password) {\n        final InnerInterfaceImpl innerInterface = new InnerInterfaceImpl();\n        return innerInterface.authUser(userName, password);\n    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0445\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435&nbsp;null \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0443\u044e\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>    private static final String USER_NAME = \"user\";\n    private static final String USER_PASSWORD = \"password\";\n    \/**\n     * do auth user\n     * @param userName user's name\n     * @param password user's password\n     * @return true if auth is successful\n     *\/\n    public boolean authUser(final String userName, final String password) {\n        return userName != null &amp;&amp; password != null &amp;&amp; userName.equals(USER_NAME) &amp;&amp; password.equals(USER_PASSWORD);\n    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e \u0432\u0441\u0451 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u0438. \u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 pom.xml:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>   &lt;properties&gt;\n        &lt;powermock.version&gt;1.7.3&lt;\/powermock.version&gt;\n        &lt;easymock.version&gt;3.5.1&lt;\/easymock.version&gt;\n    &lt;\/properties&gt;\n    &lt;dependencies&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.easymock&lt;\/groupId&gt;\n            &lt;artifactId&gt;easymock&lt;\/artifactId&gt;\n            &lt;version&gt;${easymock.version}&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;\n            &lt;artifactId&gt;powermock-module-junit4&lt;\/artifactId&gt;\n            &lt;version&gt;${powermock.version}&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;\n            &lt;artifactId&gt;powermock-api-easymock&lt;\/artifactId&gt;\n            &lt;version&gt;${powermock.version}&lt;\/version&gt;\n        &lt;\/dependency&gt;\n    &lt;\/dependencies&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 &#171;\u043f\u0440\u044f\u043c\u044b\u0445&#187; \u0442\u0435\u0441\u0442\u0430:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e,<\/li><li>\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u043a\u0430\u0437 \u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438,<\/li><li>\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f null, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u043a\u0430\u0437 \u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u043d\u0435 NullPointerException.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u044d\u0442\u0438 \u0442\u0435\u0441\u0442\u044b \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>    \/**\n     * Strict test, username and password are correct\n     *\/\n    @Test\n    public void doAuthCorrectTest() {\n        final AuthInterface authInterface = new AuthInterfaceImpl();\n        final boolean isAuth = authInterface.doAuth(USER, PASSWORD);\n        \/\/username and password are correct, we expect true\n        Assert.assertEquals(true, isAuth);\n    }\n\n    \/**\n     * Strict test, username and password are incorrect\n     *\/\n    @Test\n    public void doAuthIncorrectTest() {\n        final AuthInterface authInterface = new AuthInterfaceImpl();\n        final boolean isAuth = authInterface.doAuth(WRONG_USER, WRONG_PASSWORD);\n        \/\/username and password are incorrect, we expect false\n        Assert.assertEquals(false, isAuth );\n    }\n\n    \/**\n     * Strict test, username and password are incorrect\n     *\/\n    @Test\n    public void doAuthNullsTest() {\n        final AuthInterface authInterface = new AuthInterfaceImpl();\n        final boolean isAuth = authInterface.doAuth(null, null);\n        \/\/username and password are nulls, we expect false\n        Assert.assertEquals(false, isAuth );\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e API \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 doAuth \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438, \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0438 null \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0430\u0446\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0448\u044c\u044e Assert.assertEquals, \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044d\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u043d\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0438\u0434\u0451\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0442\u043e \u0442\u0435\u0441 \u043f\u0440\u043e\u0439\u0434\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 &#8212; \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0430\u043b\u0435\u043d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043d\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u042d\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438, \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0434\u0451\u0442 \u0432 \u0411\u0414, \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435\u0442, \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438 \u0442.\u0434. \u0438 \u0442.\u043f. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u043d\u0430\u0448, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e&nbsp;<strong>AuthInterface,&nbsp;<\/strong>\u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c&nbsp;\u0435\u0433\u043e \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e. \u0417\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043c\u0435\u0441\u0442\u043e <strong>InnerInterfaceImpl<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u042d\u0442\u0438 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0438 \u0435\u0441\u0442\u044c&nbsp;mock-\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430&nbsp;<strong>InnerInterfaceImpl&nbsp;<\/strong>\u0441\u043e\u0437\u0434\u0430\u043b \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441&nbsp;<strong>InnerInterfaceImpl.authUser&nbsp;<\/strong>\u0432\u0435\u0440\u043d\u0451\u0442 \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043c. \u041f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e (\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430) \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c PowerMock, \u0432\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c (\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043c), \u0441\u0434\u0435\u043b\u0430\u0435\u0442 EasyMock.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430, \u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f &#8212; \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c, \u0447\u0442\u043e \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; true. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u042d\u0442\u043e \u0442\u0435\u0441\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430 :-). \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>    \/**\n     * Mocking test, passing wrong values, but expecting true\n     *\n     * @throws Exception\n     *\/\n    @Test\n    public void doAuthMockAbsolutlyWrongTest() throws Exception {\n\n        final InnerInterfaceImpl innerInterfaceMock = createMock(InnerInterfaceImpl.class);\n        PowerMock.expectNew(InnerInterfaceImpl.class).andReturn(innerInterfaceMock).anyTimes();\n        expect(innerInterfaceMock.authUser(WRONG_USER, WRONG_PASSWORD)).andReturn(true).anyTimes();\n\n        final AuthInterface authInterface = new AuthInterfaceImpl();\n        PowerMock.replay(innerInterfaceMock, InnerInterfaceImpl.class);\n        final boolean isAuth = authInterface.doAuth(WRONG_USER, WRONG_PASSWORD);\n        PowerMock.verify(innerInterfaceMock);\n\n        Assert.assertEquals(true, isAuth);\n    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u0413\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 PowerMock: @RunWith(PowerMockRunner.class)<\/li><li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 \u0432\u043d\u0443\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 PowerMock.<strong>createMock<\/strong>(InnerInterfaceImpl.class)<\/li><li>\u0413\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443: PowerMock.<strong>expectNew<\/strong>(InnerInterfaceImpl.class).andReturn(innerInterfaceMock).anyTimes()<\/li><li>\u0413\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 authUser \u044d\u0442\u043e\u0439 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0441 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c true: <strong>expect(<\/strong>innerInterfaceMock.authUser(<strong>WRONG_USER, WRONG_PASSWORD<\/strong>)).andReturn(true).anyTimes()<\/li><li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 new AuthInterfaceImpl() \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 mock PowerMock.<strong>replay<\/strong>(innerInterfaceMock, InnerInterfaceImpl.class). \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0448\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430.<\/li><li>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c: isAuth = authInterface.doAuth(WRONG_USER, WRONG_PASSWORD)<\/li><li>\u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0448 mock \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d: PowerMock.<strong>verify<\/strong>(innerInterfaceMock)<\/li><li>\u0418 \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 true: Assert.assertEquals(true, isAuth)<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0443 &#171;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439&#187; \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>    \/**\n     * Mocking test:\n     * &lt;ul&gt;\n     *     &lt;li&gt;passing correct values, expecting true&lt;\/li&gt;\n     *     &lt;li&gt;passing wrong values, expecting false&lt;\/li&gt;\n     *     &lt;li&gt;passing nulls, expecting false&lt;\/li&gt;\n     * &lt;\/ul&gt;\n     *\n     * @throws Exception\n     *\/\n    @Test\n    public void doAuthMockTest() throws Exception {\n\n        final InnerInterfaceImpl innerInterfaceMock = PowerMock.createMock(InnerInterfaceImpl.class);\n        PowerMock.expectNew(InnerInterfaceImpl.class).andReturn(innerInterfaceMock).anyTimes();\n        expect(innerInterfaceMock.authUser(USER, PASSWORD)).andReturn(true).anyTimes();\n        expect(innerInterfaceMock.authUser(WRONG_USER, WRONG_PASSWORD)).andReturn(false).anyTimes();\n        expect(innerInterfaceMock.authUser(null, null)).andReturn(false).anyTimes();\n\n        final AuthInterface authInterface = new AuthInterfaceImpl();\n        PowerMock.replay(innerInterfaceMock, InnerInterfaceImpl.class);\n        final boolean isAuthCorrect = authInterface.doAuth(USER, PASSWORD);\n        final boolean isAuthIncorrect = authInterface.doAuth(WRONG_USER, WRONG_PASSWORD);\n        final boolean isAuthNulls = authInterface.doAuth(null, null);\n        PowerMock.verify(innerInterfaceMock);\n\n        Assert.assertEquals(true, isAuthCorrect);\n        Assert.assertEquals(false, isAuthIncorrect);\n        Assert.assertEquals(false, isAuthNulls);\n    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c mvn test \u0438 \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Tests run: 5, Failures: 0, Errors: 0, Skipped: 0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0434\u0432\u043e\u0436\u0443 \u0438\u0442\u043e\u0433: \u0435\u0441\u043b\u0438 \u043c\u044b \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u043b\u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043c\u043f\u043b\u0438\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e &#171;\u0437\u0430\u043c\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187;, \u0442.\u0435. \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u043e\u0439. \u042d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a \u0440\u0430\u0437\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u043d\u0430\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c <strong>\u0441\u0432\u043e\u0439<\/strong> \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0443\u043b\u0438 \u0441\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 &#8212; \u043d\u0430&nbsp;<a href=\"https:\/\/github.com\/RomanNikonorov\/unit-testing\">\u043c\u043e\u0451\u043c \u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>, \u0432\u0435\u0442\u043a\u0430 JUnit. \u0422\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0435\u0442\u043a\u0430 testng,&nbsp; \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0439 \u043e\u0442 JUnit &#8212; <a href=\"https:\/\/rnikonorov.ru\/index.php\/stati\/9-unit-testy-chast-vtoraya-testng\">\u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0440\u0443\u043a\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0441 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u041d\u0435 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0438\u0441\u0430\u043b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0410 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u043f\u043e\u0438\u0437\u0443\u0447\u0430\u0442\u044c. \u041e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0438\u043a\u043b \ud83d\ude42 \u041d\u0430\u0447\u043d\u0443 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c.\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u043c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_front_end_style_editor":"no","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-java","entry"],"_links":{"self":[{"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":3,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions\/734"}],"wp:attachment":[{"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rnikonorov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}