Year: 2018

Rest Assured – How to create POST request

Create a JSON object JSONObject requestParams = new JSONObject(); requestParams.put(“AccountId”, accountId); requestParams.put(“Amount”, amount); //Define baseURI RestAssured.baseURI = apiUrl; RestAssured.useRelaxedHTTPSValidation(); RequestSpecification request = RestAssured.given(); //Add token to request request.header(“Authorization”, token); // Add a header stating the Request body is a JSON Read More

RestAssured – how to do GET request.

Use queryParam to create GET reqeust RestAssured.baseURI = apiUrl; RestAssured.useRelaxedHTTPSValidation(); RequestSpecification request = RestAssured.given(); //Add token to request request.header(“Authorization”, token); // Add a header stating the Request body is a JSON request.header(“Content-Type”, “application/json”); // Add trxID to query param request.queryParam(“trxId”, Read More

Get autoincremental value

Get autoincremental value SHOW TABLE STATUS FROM `DatabaseName` WHERE `name` LIKE ‘TableName’ ; Query from information schema SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘DatabaseName’ AND TABLE_NAME = ‘TableName’; Change auto_incremental value ALTER TABLE table AUTO_INCREMENT = n;

Hadoop commands

List of command for hadoop List of files and directories hadoop fs -ls / List of files under user hadoop fs -ls /user Put file to hadoop hadoop fs -put text.txt /user/training/text.txt View file content hadoop fs -cat /user/training/text.txt Remove Read More

Angular CLI

Install application ng new my-app ng new my-app –dry-run ng new my-app –skip-install ng new –help Options ng new my-app –skip-install –style scss –prefix ma –skip-git –skip-test –routing ng lint –help