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…
Tag: testing
Android Espresso: How to create test-suite which may launch separate test classes with different activities?
I have just started studying Espresso tests, but I have searched throw StackOverFlow topics and couldn’t found solution for my needs. Prehistory of my question: I have android application with lots of activities. Generally separate UI tests were created for different flows of the app (each flow require …
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory
when i open apache-jmeter-3.1 and right click the test-plan button,it turns out to be no response and throws lists of errors in the jmeter.log as follows what happened and how can i fix it? thanks !!! it has bothered me a long time… Answer Normally this happens when a Dependent jar is not present or in …
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…
Can anyone tell me how to test my Camel Route if I have a choice operation?
I have a Camel route that has implemented a Content based Routing EIP(Choice operation). I need to test it. I’m new to Camel. So, I’m unsure how to do it. Can anyone tell me how to test this operation. I have mentioned a sample code below that has to be tested. Answer You can simply “advice&…
How to enable debug on my JUnit through Gradle test task
I get into trouble while I try to run my JUnit test through Gradle test task. While I run the test in eclipse directly with Run As -> JUnit test, everything is ok, the test succeeds. But through test task, test always fails. Probably some trouble with the encoding of my resource txt file. So I would like t…
How do I unit test spring security @PreAuthorize(hasRole)?
What do I need in order to unit test the hasRole part of a PreAuthorize annotation on a controller method? My test should succeed because the logged in user only has one of the two roles, but instead it fails with the following assertion error: java.lang.AssertionError: Status Expected :401 Actual :200 I have…
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…