I need to check some api. For example, I have several @Test methods in the class to test my functionality before init I connect to some URL of my service and use it.
If I have a service on multiple URLs (different server environments), how can I test this functionality for different service URLs?
Flow:
- Init conncetion by URL
- Run all tests
- Init conncetion to other URLs
- Run all tests (same thing)
- ...
When there was only one host, I like it:
public class TestAPI{ @org.junit.Before public void init() { service = new Service("www.test.com"); } @org.junit.Test public void testA(){ service.CallA(); } @org.junit.Test public void testB(){ service.CallB(); } }
Sergey
source share