Posts

Showing posts from 2017

Accessing database in AWS - Part 2 ( Refactoring your code )

I have refactored the code to as below. As you can see, I have refactored getRegistration into two methods. The first method is generic so that tomorrow if you want to use GetLoans, we could use the generic method. And also the method "getRegistration" now uses the generic method " getValueFromDatabase". I am using the scan method of AWS ( which is more intensive) than query because I have to search on a column which is NOT a partition key. If it was a partition key, I could have used "query" instead of "scan". I am using  if (scanResult.getCount() != 0) break;    to return from the scan immediately as soon as I get one result. Else it would scan the entire database and I would get a "Throughput exceeded violation/error" from AWS. import com.amazonaws.regions.Regions; import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder; import com.amazonaws.services.

Accessing AWS cloud for test data

In most of the projects today, you see that code + data is stored in the cloud. Global players like Amazon, Microsoft and Google are offering their cloud services. As a test analyst, you might be required to write tests that access data from the cloud. I faced a similar situation when the team I joined had their project in Amazon AWS. I was writing API tests using Rest Assured and I had to access the database for validation. I am providing a sample, generic method here which people can use if faced with a similar situation. First, from command line, you have to login to AWS, which saves the AWS token in your computer. From your IDE ( I use IntelliJ Idea), go to terminal ( command line) and login to aws credentials. Use your appropriate company name and user names. $ -auth l Username: l@ .com Password: ******** Select an account: [0] -production-dev [1] --preproduction-admin [2] --production-poweruser Selection: 0 Selected role: --production-dev Saved AWS token

Blogo - Your blog editor for Mac

When you post blogs, it is a hassle to log into google with your username and password, and then navigate to the different tabs and publish your post. But then there are zillions of blogger tools available which makes our job easier. I was googling for the different tools on Mac ( since I am using a Mac) and I found this link. => https://www.shoutmeloud.com/5-desktop-blogging-softwares-for-mac.html I found the above site very useful and I have selected “Blogs” from this list because it seems to have a lot of functionality, is free, easy installation and seems to be light on the computer resources. Blogo is defined as " Blogo - Simple, powerful blog editor app - By Blogo, Inc”. I am trying out this blogger and will provide updates as soon as I have experimented ( tested ) it with extensive blogs, customizations. I will rate it based on 1. Functionality 2. Ease of use 3. Ease of installation and removal 4. Cost ( Free !) 5. Overall user happiness.