Open sourcing my workshop: an experiment

This is an experiment I’ve been thinking about for some time now. I have absolutely no idea how it will turn out, but hey, there’s only one way to find out!

What is an open source workshop?
I have recently created a workshop and delivered this with reasonable success to an audience of Dutch testers. I have received and processed the feedback I got that day, and now it’s time for the next step: I’m making it open source. This means that I’m giving everybody full access to the slides, the exercises and their solutions and the notes I have used in the workshop. I’m hoping this leads to:

  • Feedback on how to further improve the contents and the presentation of the workshop
  • More people delivering this workshop and spreading the knowledge it contains

What is the workshop about and who is it for?
The original version of this workshop is an introduction to RESTful web services and how to write tests for these web services using REST Assured. It is intended for testers with some basic Java programming skills and an interest in web service and API testing. However, as you start to modify the workshop to your personal preferences, both the contents and the target audience may of course change.

A simplified outline of the workshop looks like this:

  1. An introduction to RESTful web services and their use in modern IT applications
  2. An introduction to REST Assured as a tool to write tests for these services
  3. Setup of REST Assured and where to find documentation
  4. Introduction of the application under test
  5. Basic REST Assured features, Hamcrest and GPath
  6. Parameterization of tests
  7. Writing tests for secure web services
  8. Reuse: sharing variables between tests

The workshop comes with a couple of small (this workshop was originally designed to be delivered in 3 hours) sets of exercises and their solutions.

Prerequisites and installation instructions
As stated before, the workshop participants should have an interest in test automation, some basic Java (or any other object oriented programming language) knowledge as well as a grasp of the contents of web services.

The exercises are contained within a Maven project. As REST Assured is a Java library, in order to get things working you need a recent JDK and an IDE with support for Maven. Since TestNG is used as a test runner in the examples, your IDE should support this as well (see the TestNG web site for instructions), but feel free to rewrite the exercises to use your test framework of choice. I just happen to like TestNG.

So where can I find all these goodies?
That’s an easy one: on my GitHub repo.

How can I contribute?
I hope that by now you’re at least curious and maybe even enthusiastic about trying out this workshop and maybe even thinking of contributing to it. You can do so in various ways:

  • By giving me constructive feedback on either the concept of an open source workshop, the contents of this particular workshop, or both.
  • By spreading the word. I’d love for you to let your friends, colleagues or anyone else in your network know that this workshop exists. The more feedback I get, the better this workshop becomes.
  • By actually delivering the workshop yourself and letting me know how it turned out. That’s a great form of feedback!

Interesting, but I have some questions…
Sure! Just submit a comment to this post or send me an email at bas@ontestautomation.com. Especially if you’re planning to deliver the workshop, but feel you are stuck in some way. Also, please don’t forget to share the raving reviews you got (or stories on why and where you got booed off the stage..)! Remember that this is an experiment for me too, and if it turns out to be a successful one I definitely will create and publish more of these workshops in the future.

And on a final note, if you’re interested in having this workshop delivered at your organization, but you don’t feel comfortable doing it yourself, please let me know as well. I am happy to discuss the options available and work something out.

36 thoughts on “Open sourcing my workshop: an experiment

    • Hey Kiran,

      thanks! As said, I have a couple of good ideas, but I want to wait a little to see what kind of reactions this experiment triggers..

  1. Pingback: Java Web Weekly, Issue 129 | Baeldung

  2. Pingback: Testing Bits – 6/12/16 – 6/18/16 | Testing Curator Blog

  3. Bas Cool Stuff really helped me with Rest Api Thanks. Although i faced an issue where in my Maven Test run wouldn’t run the testng – Test’s under the class files .. i den renamed them by updating the classnames to have “Test” – then only the test were fired – was just wondering how did u/others manged to run them as is ?
    Please correct me as this was my first experience working with maven builds 🙂 .

  4. Bas , Thanks a ton for sharing this repo. I will try to submit PR for missing scenarios if any.

    I’ve few doubts kindly clarify.

    1. My dev team says they have unit tests written to test API. Per them testing again with rest-assured will be redundant ? Do you agree with this ?

    2. They need my help with integration testing , but I’m not exactly sure
    2.1 what they mean by integration testing ?
    2.2 how can I use rest-assured for the same ?

    Thanks in advance.

    Regards,
    Vikram

      • It seems like your developers are contradicting themselves… First they say that integration / end-to-end testing with rest-assured is redundant, then they need your help with integration testing?

        I don’t know what they mean with integration testing, it depends on the components they are integrating. An API implementation, depending on its complexity, can be built from several components, organized in multiple layers. All tests where multiple components are tested as a single object are integration tests. It might still be that there is no actual database involved, but that it is mocked, for example. It’s still an integration test.

        When you’re testing the full API, from sending a HTTP request through a HTTP connection all the way down to the database where data is retrieved, stored or manipulated, back to the HTTP response that is again sent through the HTTP connection to the client, it’s called end-to-end testing.

        In short: start thinking about API’s and applications in components and layers. And ask your developers to make you a diagram of what they see as integration testing.

        I hope that helps a bit, if not, please do let me know.
        One component, one layer: unit testing
        Multiple components, one layer: integration testing
        Multiple components, multiple layers: integration testing
        All components, all layers: end-to-end testing

        • Hi Bas,

          Sorry I missed your comment earlier. ( email notification failed for some reason )

          Thanks for detailed insights on this topic. I found people use terms quite loosely and not sure what they exactly meant.

          Best Regards,
          Vikram

  5. Pingback: RESTful API Testing – VikramVI Knowledge Sharing

  6. Hello Bas,

    I have been wondering if you could advise how this project should be opened in IntelliJ? I have cloned the repo, but IntelliJ highlights all the imports. I tried to add “answers” and “exercises” as test folders, but that didn’t help either. Please help 🙂

    • Hi Pawel,

      sorry for not getting back to you earlier! I have no idea why IntelliJ won’t import this project. I’m no IntelliJ user, but from what I’ve heard importing Maven-based existing projects should be really straightforward there…

  7. Hi Bas,

    I am facing this error on making a Get Request to API

    cucumber.runtime.CucumberException: java.net.ConnectException: Connection refused: connect

    Here is my code :
    response= given().parameters(parameterMap).get(“url”);
    System.out.println(“response: ” + response.prettyPrint());

    • It means that your JVM couldn’t connect to the URL that you supplied, so probably that one is wrong. If the code you used is literally the same as what you supplied in the comment, then I see where it comes from, because “url” is not a valid URL.

  8. Hey Bas,
    thats a dummy value “url” i typed there. in actual I am using a valid AWS url which asks me authentication.

    below is my baseURI =http://api­aws­eu­qa­1.auto1­test.com

    When I hit this url it asks for authentication

    I am told that there is wa_key which is only parameter required to authenticate

    but when I make below Get Request below with parameter as wa_key and locale

    GET /v1/car­types/manufacturer

    ○ locale (accepts any locale)

    ○ wa_key

    it simply says unauthorize response from server. I am not sure if I am doing some thing wrong or there is some missing information I am not provided.

    • Hi Rehan,

      does that wa_key parameter represent an OAuth(2) authentication token? Tokens like that usually have a limited time window in which they’re valid, so you can’t reuse them forever. Either that, or you’re not using the correct token. That’s very hard to say from here..

  9. Hi Bas,

    I am not sure if it use OAuth(2) or not? How can I konw which authentication token is being used for my request?

  10. Hi Bas,

    This is given to me as part of a test for a role. I have asked the person who gave me to give me authentication details but they say wa_key is the only parameter which is needed to authenticate.

    • But they didn’t give you a working parameter value for that wa_key? How would you be able to authenticate successfully then?

  11. They have provided me wa_key parameter value but even with that value i am not able to authenticate it simply returns 401 ( unauthorized) response both through code and postman tool.
    wa_key=coding-­puzzle-­client­-449cc9d

    I passed this key as a request header in postman and made below get request with two parameters

    GET /v1/car­types/manufacturer

    ○ locale (accepts any locale)

    ○ wa_key

    but it says unauthorized

    • I tried two things:

      * Pass the parameter as a simple key-value pair
      * Use the parameter value as an OAuth2 token

      Both resulted in the same HTTP 401.

      Without any further details on how to authenticate I have no idea either.

    • Hi Anand,

      You can simply download all the materials from the GitHub link I included in the post.

      A video course is on its way, but that’ll probably take another few months.

Leave a Reply

Your email address will not be published. Required fields are marked *