diff --git a/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorUnitTest.java b/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java similarity index 91% rename from core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorUnitTest.java rename to core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java index 69c802feb8..bc63fbe6f7 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorUnitTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java @@ -1,22 +1,17 @@ package com.baeldung.concurrent.future; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; -public class SquareCalculatorUnitTest { +import java.util.concurrent.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class SquareCalculatorIntegrationTest { @Rule public TestName name = new TestName(); diff --git a/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueUnitTest.java b/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java similarity index 96% rename from core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueUnitTest.java rename to core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java index 0272726465..2a8eda896b 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueUnitTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java @@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.util.Lists.newArrayList; -public class PriorityBlockingQueueUnitTest { +public class PriorityBlockingQueueIntegrationTest { @Test public void givenUnorderedValues_whenPolling_thenShouldOrderQueue() throws InterruptedException { diff --git a/core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetTest.java b/core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetIntegrationTest.java similarity index 98% rename from core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetTest.java rename to core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetIntegrationTest.java index a2dbbae520..92fff8446b 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/skiplist/ConcurrentSkipListSetIntegrationTest.java @@ -13,7 +13,7 @@ import java.util.stream.IntStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class ConcurrentSkipListSetTest { +public class ConcurrentSkipListSetIntegrationTest { @Test public void givenThreadsProducingEvents_whenGetForEventsFromLastMinute_thenReturnThoseEventsInTheLockFreeWay() throws InterruptedException { diff --git a/core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalTest.java b/core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalIntegrationTest.java similarity index 96% rename from core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalTest.java rename to core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalIntegrationTest.java index ac2e8fbe63..cc4b4f021a 100644 --- a/core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalTest.java +++ b/core-java/src/test/java/com/baeldung/threadlocal/ThreadLocalIntegrationTest.java @@ -7,7 +7,7 @@ import java.util.concurrent.ExecutionException; import static org.junit.Assert.assertEquals; -public class ThreadLocalTest { +public class ThreadLocalIntegrationTest { @Test public void givenThreadThatStoresContextInAMap_whenStartThread_thenShouldSetContextForBothUsers() throws ExecutionException, InterruptedException { //when diff --git a/core-java/src/test/java/com/baeldung/transferqueue/TransferQueueTest.java b/core-java/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java similarity index 98% rename from core-java/src/test/java/com/baeldung/transferqueue/TransferQueueTest.java rename to core-java/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java index 1af9821ed0..e49738e983 100644 --- a/core-java/src/test/java/com/baeldung/transferqueue/TransferQueueTest.java +++ b/core-java/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java @@ -9,7 +9,7 @@ import java.util.concurrent.*; import static junit.framework.TestCase.assertEquals; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class TransferQueueTest { +public class TransferQueueIntegrationTest { @Test public void whenMultipleConsumersAndProducers_thenProcessAllMessages() throws InterruptedException { diff --git a/disruptor/src/test/java/com/baeldung/disruptor/DisruptorTest.java b/disruptor/src/test/java/com/baeldung/disruptor/DisruptorIntegrationTest.java similarity index 95% rename from disruptor/src/test/java/com/baeldung/disruptor/DisruptorTest.java rename to disruptor/src/test/java/com/baeldung/disruptor/DisruptorIntegrationTest.java index 28a5ff72ce..10929f21b0 100644 --- a/disruptor/src/test/java/com/baeldung/disruptor/DisruptorTest.java +++ b/disruptor/src/test/java/com/baeldung/disruptor/DisruptorIntegrationTest.java @@ -1,16 +1,17 @@ package com.baeldung.disruptor; -import java.util.concurrent.ThreadFactory; -import org.junit.Before; -import org.junit.Test; import com.lmax.disruptor.BusySpinWaitStrategy; import com.lmax.disruptor.RingBuffer; import com.lmax.disruptor.WaitStrategy; import com.lmax.disruptor.dsl.Disruptor; import com.lmax.disruptor.dsl.ProducerType; import com.lmax.disruptor.util.DaemonThreadFactory; +import org.junit.Before; +import org.junit.Test; -public class DisruptorTest { +import java.util.concurrent.ThreadFactory; + +public class DisruptorIntegrationTest { private Disruptor disruptor; private WaitStrategy waitStrategy; @@ -21,7 +22,7 @@ public class DisruptorTest { private void createDisruptor(final ProducerType producerType, final EventConsumer eventConsumer) { final ThreadFactory threadFactory = DaemonThreadFactory.INSTANCE; - disruptor = new Disruptor(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy); + disruptor = new Disruptor<>(ValueEvent.EVENT_FACTORY, 16, threadFactory, producerType, waitStrategy); disruptor.handleEventsWith(eventConsumer.getEventHandler()); } diff --git a/spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBTest.java b/spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBIntegrationTest.java similarity index 93% rename from spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBTest.java rename to spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBIntegrationTest.java index 2c40c5b117..1fcc4be45d 100644 --- a/spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBTest.java +++ b/spring-jpa/src/test/java/org/baeldung/persistence/repository/InMemoryDBIntegrationTest.java @@ -1,7 +1,8 @@ package org.baeldung.persistence.repository; -import javax.annotation.Resource; - +import org.baeldung.config.StudentJpaConfig; +import org.baeldung.persistence.dao.StudentRepository; +import org.baeldung.persistence.model.Student; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; @@ -9,16 +10,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import org.springframework.transaction.annotation.Transactional; -import org.baeldung.config.StudentJpaConfig; -import org.baeldung.persistence.model.Student; -import org.baeldung.persistence.dao.StudentRepository; +import javax.annotation.Resource; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { StudentJpaConfig.class }, loader = AnnotationConfigContextLoader.class) @Transactional -public class InMemoryDBTest { +public class InMemoryDBIntegrationTest { @Resource private StudentRepository studentRepository; diff --git a/spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerTest.java b/spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java similarity index 98% rename from spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerTest.java rename to spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java index a1f9e71bec..1dae559371 100644 --- a/spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerTest.java +++ b/spring-rest/src/test/java/org/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java @@ -26,7 +26,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = WebConfig.class) @WebAppConfiguration -public class HeavyResourceControllerTest { +public class HeavyResourceControllerIntegrationTest { private MockMvc mockMvc; diff --git a/spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerTest.java b/spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerIntegrationTest.java similarity index 96% rename from spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerTest.java rename to spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerIntegrationTest.java index a38177f78b..9ef2dfa215 100644 --- a/spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerTest.java +++ b/spring-rest/src/test/java/org/baeldung/web/controller/mediatypes/CustomMediaTypeControllerIntegrationTest.java @@ -18,7 +18,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = WebConfig.class) @WebAppConfiguration -public class CustomMediaTypeControllerTest { +public class CustomMediaTypeControllerIntegrationTest { private MockMvc mockMvc; diff --git a/spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerTest.java b/spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerIntegrationTest.java similarity index 88% rename from spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerTest.java rename to spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerIntegrationTest.java index f2f00a40d8..7bd16a3e97 100644 --- a/spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerTest.java +++ b/spring-rest/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleControllerIntegrationTest.java @@ -1,15 +1,6 @@ package org.baeldung.web.test; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import org.baeldung.config.WebConfig; import org.junit.Before; import org.junit.Test; @@ -22,11 +13,17 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = WebConfig.class) @WebAppConfiguration -public class BazzNewMappingsExampleControllerTest { +public class BazzNewMappingsExampleControllerIntegrationTest { private MockMvc mockMvc; diff --git a/spring-session/pom.xml b/spring-session/pom.xml index 2c8b15a6eb..79095cbfbb 100644 --- a/spring-session/pom.xml +++ b/spring-session/pom.xml @@ -59,7 +59,7 @@ maven-surefire-plugin - **/*ControllerTest.java + **/*IntegrationTest.java diff --git a/spring-session/src/test/java/com/baeldung/spring/session/SessionControllerTest.java b/spring-session/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java similarity index 97% rename from spring-session/src/test/java/com/baeldung/spring/session/SessionControllerTest.java rename to spring-session/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java index c8138889b2..84dd2bc139 100644 --- a/spring-session/src/test/java/com/baeldung/spring/session/SessionControllerTest.java +++ b/spring-session/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java @@ -11,7 +11,7 @@ import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class SessionControllerTest { +public class SessionControllerIntegrationTest { private Jedis jedis; private TestRestTemplate testRestTemplate;