GH-1126 Fixed default app port in Tests

Ensured AggregateApplicationTests, AggregateWithMainTest and AggregationTest arn't using default 8080 port
This commit is contained in:
Oleg Zhurakousky
2017-11-08 13:06:40 -05:00
parent b9884ae71a
commit 4e69ead7b4
3 changed files with 22 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ package org.springframework.cloud.stream.config.aggregate;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,6 +43,11 @@ import static org.hamcrest.Matchers.notNullValue;
@RunWith(SpringJUnit4ClassRunner.class)
public class AggregateApplicationTests {
@Before
public void before() {
System.setProperty("server.port", "0");
}
@Test
@SuppressWarnings("unchecked")
public void testAggregateApplication() throws Exception {