mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
setting the config to be null to avoid intermittent failure.
This commit is contained in:
parent
a5c2228664
commit
9da6b07ea3
@ -24,6 +24,7 @@ import org.wso2.carbon.device.mgt.analytics.data.publisher.config.InvalidConfigu
|
|||||||
import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +34,10 @@ public class DataPublisherConfigTest extends BaseAnalyticsDataPublisherTest {
|
|||||||
|
|
||||||
@Test(description = "Validating the behaviour od getInstance of the config before calling the init",
|
@Test(description = "Validating the behaviour od getInstance of the config before calling the init",
|
||||||
expectedExceptions = InvalidConfigurationStateException.class)
|
expectedExceptions = InvalidConfigurationStateException.class)
|
||||||
public void testGetInstanceWithoutInit() {
|
public void testGetInstanceWithoutInit() throws NoSuchFieldException, IllegalAccessException {
|
||||||
|
Field configField = AnalyticsConfiguration.class.getDeclaredField("config");
|
||||||
|
configField.setAccessible(true);
|
||||||
|
configField.set(configField, null);
|
||||||
AnalyticsConfiguration.getInstance();
|
AnalyticsConfiguration.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user