pavankjadda / eShopping

eShopping application implemented with Spring Boot, Spring Security, Spring Data and Spring Session
GNU General Public License v3.0
10 stars 10 forks source link

Failed to execute Unit Tests Exception => hazelcast exception: java.net.socketexception #38

Closed pavankjadda closed 5 years ago

pavankjadda commented 5 years ago

An exception occurred while executing Unit Tests exception: java.net.socketexception

2019-05-06 00:04:10.501  WARN 22888 --- [ient_0.cluster-] c.h.c.c.ClientConnectionManager          : hz.client_0 [dev] [3.11.2] Exception during initial connection to [127.0.0.1]:5703, exception com.hazelcast.core.HazelcastException: java.net.SocketException: Connection refused to address /127.0.0.1:5703
pavankjadda commented 5 years ago

Add the following code to start hazelcast instance before starting the Test class

    @Autowired
    static Config config;

    @BeforeClass
    public static void onlyOnce()
    {
        Hazelcast.newHazelcastInstance(config);
    }