Skip to content

Tag: testing

Create Post Api in Java for Test Rail

Im trying to create a java post request to create a test run on test rail, however it doesn’t seem to be working heres my code: The testrail documentation is here im looking for the add run http://docs.gurock.com/testrail-api2/reference-runs Any help here how to make this actually work , is completing b…

Test if an exception is caught with Junit

I’ll begin with a code example; I have to test a function, which handles data-packets. In this function, the data-packet is opened and when it doesn’t contain all expected data, an InvalidParameterExeption is thrown which is logged. So, if everything goes well, my exception is printed in my termin…

TestNG. can’t run a single test method

I have Selenium+Eclipse+Java Project+Eclipse TestNG plugin. For example, my code is: When i run TestClass as TestNG, both tests are executed. I can’t understand why test2 is executed also. Because there is a comment “//” before @Test annotations. Any ideas? thanks in advance Answer First, yo…

Mockito mock objects returns null

I try to implement some tests for my JSF application and for the mocks I am using mockito. (I also use spring) The test succeeds, but when I want to retrieve the instance with the getInstance method. All Parameters which I have set before (via the constructor before) are null. I am new to mocked objects, so i…

Exclude individual test from ‘before’ method in JUnit

All tests in my test class execute a ‘before’ method (annotated with JUnit’s @Before) before the execution of each test. I need a particular test not to execute this before method. Is there a way to do it? Answer Unfortunately you have to code this logic. JUnit does not have such feature. Ge…