From 154c5e95b5d04deadc0ff0926abf7d694036e0e6 Mon Sep 17 00:00:00 2001 From: "m.dalakov" Date: Tue, 17 Oct 2017 18:00:48 +0300 Subject: [PATCH] *update javaDoc --- .../main/java/com/samsung/ci/basic/api/Alive.java | 9 ++++++++- .../java/com/samsung/ci/basic/api/AppConfigInit.java | 3 +++ .../java/com/samsung/ci/basic/api/MQListenerAPI.java | 4 ++-- .../com/samsung/ci/basic/api/MQPublisherAPI.java | 8 ++++---- .../main/java/com/samsung/ci/basic/api/Reports.java | 4 ++-- .../src/main/java/com/samsung/ci/basic/api/Rest.java | 20 +++++++++++--------- .../maven/plugin/surefire/log/api/ConsoleLogger.java | 4 ++-- ...egistrationAndUnregistrationWithoutCloudTest.java | 1 - .../samsung/ci/test/mq/PolicyWitoutCloudTest.java | 7 +++---- .../samsung/ci/test/mq/ReportsWithOutCloudTest.java | 7 +++---- .../java/com/samsung/ci/test/reports/TIAReports.java | 8 +++++++- .../samsung/ci/test/reports/TestRestRuleReports.java | 9 +++++++++ .../test/useractions/AuthorizedUsingCloudTest.java | 5 ++--- .../samsung/ci/test/useractions/BasicUserAction.java | 11 +++++++++-- .../ci/test/useractions/IotAliveStatusTest.java | 9 +++++++++ 15 files changed, 74 insertions(+), 35 deletions(-) diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Alive.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Alive.java index 2683d0c..d01b8f1 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Alive.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Alive.java @@ -27,7 +27,7 @@ import static java.lang.String.format; import io.restassured.response.Response; /** - * + * The type Alive. * * @author Mail to: Oleksandr Abakumov * @version 1.0 @@ -50,6 +50,13 @@ public final class Alive { private Alive() { } + /** + * Alive response. + * + * @param username the username + * @param password the password + * @return the response + */ public static Response alive(String username, String password) { Response resp = given().when().get(ALIVE_URI + format("/alive/restapi/alive/devices/%s/%s", username, password)); resp.then().log().all(); diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/AppConfigInit.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/AppConfigInit.java index 8c334fc..07fe33f 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/AppConfigInit.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/AppConfigInit.java @@ -62,6 +62,9 @@ public class AppConfigInit { return ENV; } + /** + * Instantiates a new App config init. + */ protected AppConfigInit(){ } } diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQListenerAPI.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQListenerAPI.java index 5818553..3be1a0f 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQListenerAPI.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQListenerAPI.java @@ -90,7 +90,7 @@ public final class MQListenerAPI { * Get all messages from topic * * @param consumer the consumer - * @return messages + * @return messages messages */ public static List getMessages(KafkaConsumer consumer) { LOG.info("Get messages"); @@ -117,7 +117,7 @@ public final class MQListenerAPI { * Parse message * * @param data the data - * @return map + * @return map map */ public static Map extract(byte[] data) { LOG.info("Parse message"); diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQPublisherAPI.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQPublisherAPI.java index 71c7d1a..68c31ec 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQPublisherAPI.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/MQPublisherAPI.java @@ -71,7 +71,7 @@ public final class MQPublisherAPI { * @param agent the agent * @param parentUuid the parent uuid * @param policy the policy - * @return boolean + * @return boolean boolean */ public static boolean sendPolisyToDSM(String duid, String agent, String parentUuid, String policy) { Map messageMap = new HashMap<>(); @@ -90,7 +90,7 @@ public final class MQPublisherAPI { * * @param report the report * @param duid the duid - * @return boolean + * @return boolean boolean */ public static boolean sendReportToDSM(String report, String duid) { Map messageMap = new HashMap<>(); @@ -111,7 +111,7 @@ public final class MQPublisherAPI { * @param type the type * @param model the model * @param parentUuid the parent uuid - * @return boolean + * @return boolean boolean */ public static boolean deviceRegistrationInDSM(String duid, String uuid, String name, String type, String model, String parentUuid) { @@ -133,7 +133,7 @@ public final class MQPublisherAPI { * * @param duid the duid * @param action the action - * @return boolean + * @return boolean boolean */ public static boolean deviceUnRegistrationInDSM(String duid, String action) { Map messageMap = new HashMap<>(); diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Reports.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Reports.java index f549155..67fbd25 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Reports.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Reports.java @@ -55,7 +55,7 @@ public final class Reports { * Find reports by result response. * * @param result the result - * @return response + * @return response response */ public static Response findReportsByResult(Integer result) { Response resp = given().pathParam("result", result).accept(ContentType.JSON).when() @@ -81,7 +81,7 @@ public final class Reports { * Find reports by date between response. * * @param dateFrom the date from - * @param dateTo the date to + * @param dateTo the date to * @return the response */ public static Response findReportsByDateBetween(Date dateFrom, Date dateTo) { diff --git a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Rest.java b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Rest.java index 5b51dd7..ab8728c 100644 --- a/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Rest.java +++ b/servers/api-integration-tests/src/main/java/com/samsung/ci/basic/api/Rest.java @@ -53,7 +53,7 @@ public final class Rest { * Get auth2 code from DSM * * @param login - user email is used as a login - * @param pass - user password + * @param pass - user password * @return - Auth2 from DSM */ public static String getAuthCode(String login, String pass) { @@ -95,8 +95,8 @@ public final class Rest { * Create IoTUser DSM * * @param email - user email - * @param uuid the uuid - * @return response + * @param uuid the uuid + * @return response response */ public static Response createIoTUser(String email, String uuid) { Response resp = given().params("email", email).params("uuid", uuid).when() @@ -109,7 +109,7 @@ public final class Rest { * Delete IoTUser DSM * * @param uuid the uuid - * @return response + * @return response response */ public static Response deleteIoTUser(String uuid) { Response resp = given().params("uuid", uuid).when() @@ -146,7 +146,7 @@ public final class Rest { * Get all reports from device by duid * * @param duid the duid - * @return response + * @return response response */ public static Response findReportsByDeviceUuid(String duid) { Response resp = given().when().get(RestAssured.baseURI + "/dsm/restapi/report/" + duid); @@ -156,8 +156,9 @@ public final class Rest { /** * Send rules to DSM - * @param rules - * @return response + * + * @param rules the rules + * @return response response */ public static Response sendRules(String rules) { Response resp = given().body(rules).when().post(RestAssured.baseURI + "/dsm/restapi/rule/set"); @@ -167,8 +168,9 @@ public final class Rest { /** * Remove rules from DSM - * @param rules - * @return response + * + * @param rules the rules + * @return response response */ public static Response removeRules(String rules) { Response resp = given().body(rules).when().post(RestAssured.baseURI + "/dsm/restapi/rule/remove"); diff --git a/servers/api-integration-tests/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLogger.java b/servers/api-integration-tests/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLogger.java index 318d837..55d242f 100644 --- a/servers/api-integration-tests/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLogger.java +++ b/servers/api-integration-tests/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLogger.java @@ -64,7 +64,7 @@ public interface ConsoleLogger { /** * Simply delegates to {@link #error(String) error( toString( t, message ) - * )}*. + * )}**. * * @param message message to log * @param t exception, message and trace to log @@ -73,7 +73,7 @@ public interface ConsoleLogger { /** * Simply delegates to method {@link #error(String, Throwable) error(null, - * Throwable)}*. + * Throwable)}**. * * @param t exception, message and trace to log */ diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/DeviceRegistrationAndUnregistrationWithoutCloudTest.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/DeviceRegistrationAndUnregistrationWithoutCloudTest.java index ec74276..853d9ac 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/DeviceRegistrationAndUnregistrationWithoutCloudTest.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/DeviceRegistrationAndUnregistrationWithoutCloudTest.java @@ -49,7 +49,6 @@ import io.restassured.response.Response; * @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea) * @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved. */ - public class DeviceRegistrationAndUnregistrationWithoutCloudTest extends BasicUserAction { private static final int HTTP_PAGE_NOT_FOUBD_STATUS = 404; diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/PolicyWitoutCloudTest.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/PolicyWitoutCloudTest.java index 07a50f8..b5d6f80 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/PolicyWitoutCloudTest.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/PolicyWitoutCloudTest.java @@ -52,7 +52,6 @@ import com.samsung.ci.test.useractions.BasicUserAction; * @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea) * @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved. */ - public class PolicyWitoutCloudTest extends BasicUserAction { private static final String DEVICE_DUID = "00000000-1111-2222-3333-4444444444444"; @@ -161,7 +160,7 @@ public class PolicyWitoutCloudTest extends BasicUserAction { * 13. Delete IoTCloud User * * @throws InterruptedException the interrupted exception - * @throws IOException the io exception + * @throws IOException the io exception */ @Test public void testTVPolicyPositiveTestCase() throws InterruptedException, IOException { @@ -219,9 +218,9 @@ public class PolicyWitoutCloudTest extends BasicUserAction { * 13. Delete IoTCloud User * * @throws InterruptedException the interrupted exception - * @throws IOException the io exception + * @throws IOException the io exception */ - // @Disabled +// @Disabled @Test public void testPhonePolicyPositiveTestCase() throws InterruptedException, IOException { Thread.sleep(TIMEOUT); diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/ReportsWithOutCloudTest.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/ReportsWithOutCloudTest.java index 956afaa..88a9605 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/ReportsWithOutCloudTest.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/mq/ReportsWithOutCloudTest.java @@ -53,7 +53,6 @@ import static org.junit.Assert.assertTrue; * @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea) * @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved. */ - public class ReportsWithOutCloudTest extends BasicUserAction { private static final String SMACK = "smack"; @@ -184,7 +183,7 @@ public class ReportsWithOutCloudTest extends BasicUserAction { * 11. Delete IoTCloud User * * @throws InterruptedException the interrupted exception - * @throws IOException the io exception + * @throws IOException the io exception */ @Test public void testReportsSaveForAllType() throws InterruptedException, IOException { @@ -239,7 +238,7 @@ public class ReportsWithOutCloudTest extends BasicUserAction { * 12. Delete IoTCloud User * * @throws InterruptedException the interrupted exception - * @throws IOException the io exception + * @throws IOException the io exception */ @Test public void testReportsSaveForAllTypeWithSmackTest() throws InterruptedException, IOException { @@ -297,7 +296,7 @@ public class ReportsWithOutCloudTest extends BasicUserAction { * 11. Check remove all user information * * @throws InterruptedException the interrupted exception - * @throws IOException the io exception + * @throws IOException the io exception */ public void testUserFullRemoveInformation() throws InterruptedException, IOException { Thread.sleep(TIMEOUT); diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TIAReports.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TIAReports.java index e86d206..ef4ad01 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TIAReports.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TIAReports.java @@ -51,7 +51,6 @@ import static org.junit.Assert.assertTrue; * @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea) * @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved. */ - public class TIAReports extends BasicUserAction { private static final String DEVICE_DUID = "TIA-0000000-1111-2222-3333-4444444444444"; @@ -167,6 +166,13 @@ public class TIAReports extends BasicUserAction { assertReportEquals(DLP, DLP_REPORT_EXPECTED); } + /** + * Test tia reports. + * + * @throws InterruptedException the interrupted exception + * @throws IOException the io exception + * @throws ParseException the parse exception + */ @Test public void testTIAReports() throws InterruptedException, IOException, ParseException { log("Create new user for TIA get report scenario"); diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TestRestRuleReports.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TestRestRuleReports.java index a95a6f0..4586ee5 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TestRestRuleReports.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/reports/TestRestRuleReports.java @@ -22,6 +22,9 @@ import com.samsung.ci.test.useractions.BasicUserAction; import io.restassured.response.Response; +/** + * The type Test rest rule reports. + */ public class TestRestRuleReports extends BasicUserAction { private static final String SYSCALL = "syscall"; @@ -115,6 +118,12 @@ public class TestRestRuleReports extends BasicUserAction { } } + /** + * Test reports save for syscall type with smack test. + * + * @throws InterruptedException the interrupted exception + * @throws IOException the io exception + */ @Test public void testReportsSaveForSyscallTypeWithSmackTest() throws InterruptedException, IOException { Thread.sleep(TIMEOUT); diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/AuthorizedUsingCloudTest.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/AuthorizedUsingCloudTest.java index c99b93c..5c11b36 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/AuthorizedUsingCloudTest.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/AuthorizedUsingCloudTest.java @@ -47,7 +47,6 @@ import io.restassured.response.Response; * @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea) * @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved. */ - @RunWith(SpringJUnit4ClassRunner.class) public class AuthorizedUsingCloudTest extends BasicUserAction { @@ -84,8 +83,8 @@ public class AuthorizedUsingCloudTest extends BasicUserAction { * 9. Delete new DSM user * 10. Logout * - * @throws URISyntaxException the uri syntax exception - * @throws OcException the oc exception + * @throws URISyntaxException the uri syntax exception + * @throws OcException the oc exception * @throws InterruptedException the interrupted exception */ @Test diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/BasicUserAction.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/BasicUserAction.java index b518d5f..5295bea 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/BasicUserAction.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/BasicUserAction.java @@ -177,7 +177,7 @@ public class BasicUserAction { * Gets auth code. * * @param email the email - * @param pass the pass + * @param pass the pass * @return the auth code */ protected String getAuthCode(String email, String pass) { @@ -196,6 +196,13 @@ public class BasicUserAction { return Rest.getToken(code); } + /** + * Alive boolean. + * + * @param username the username + * @param password the password + * @return the boolean + */ protected Boolean alive(String username, String password) { log("get alive status"); Response resp = Alive.alive(username, password); @@ -219,7 +226,7 @@ public class BasicUserAction { * Create io t user response. * * @param email the email - * @param uuid the uuid + * @param uuid the uuid * @return the response */ protected Response createIoTUser(String email, String uuid) { diff --git a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/IotAliveStatusTest.java b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/IotAliveStatusTest.java index b6c5f58..0e25d29 100644 --- a/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/IotAliveStatusTest.java +++ b/servers/api-integration-tests/src/test/java/com/samsung/ci/test/useractions/IotAliveStatusTest.java @@ -7,6 +7,8 @@ import org.junit.Test; import java.net.URISyntaxException; /** + * The type Iot alive status test. + * * @author Mail to: Oleksandr Abakumov * @version 1.0 * @file IotAliveStatusTest @@ -32,6 +34,13 @@ public class IotAliveStatusTest extends BasicUserAction { //@formatter:on } + /** + * Test alive status. + * + * @throws URISyntaxException the uri syntax exception + * @throws OcException the oc exception + * @throws InterruptedException the interrupted exception + */ @Test public void testAliveStatus() throws URISyntaxException, OcException, InterruptedException { alive(ADMIN_EMAIL, ADMIN_PASSWORD); -- 2.7.4