diff --git a/src/test/java/io/castle/client/CastleSeparateClassLoaderTest.java b/src/test/java/io/castle/client/CastleSeparateClassLoaderTest.java deleted file mode 100644 index 4012501..0000000 --- a/src/test/java/io/castle/client/CastleSeparateClassLoaderTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.castle.client; - -import org.junit.Test; - -public class CastleSeparateClassLoaderTest { - - @Test(expected = IllegalStateException.class) - public void sdkWithoutInitializationThrowAIllegalStateException() { - - //Given - - //When the sdk is called without initialization - Castle.instance(); - - //Then exception is thrown - } - -} \ No newline at end of file diff --git a/src/test/java/io/castle/client/CastleTest.java b/src/test/java/io/castle/client/CastleTest.java index c0d62aa..4fd5a9c 100644 --- a/src/test/java/io/castle/client/CastleTest.java +++ b/src/test/java/io/castle/client/CastleTest.java @@ -58,6 +58,17 @@ public void sdkOnTestLoadTheCorrectConfiguration() throws CastleSdkConfiguration ); } + @Test(expected = IllegalStateException.class) + public void sdkWithoutInitializationThrowAIllegalStateException() { + + //Given + + //When the sdk is called without initialization + Castle.instance(); + + //Then exception is thrown + } + @Test public void sdkProvideASingleton() throws CastleSdkConfigurationException { diff --git a/src/test/java/io/castle/client/CastleTrackHttpTest.java b/src/test/java/io/castle/client/CastleTrackHttpTest.java index 881809f..9fb036d 100644 --- a/src/test/java/io/castle/client/CastleTrackHttpTest.java +++ b/src/test/java/io/castle/client/CastleTrackHttpTest.java @@ -32,10 +32,9 @@ public CastleTrackHttpTest() { @Test public void trackWithManualContext() throws Exception { server.enqueue(new MockResponse()); - Castle.setSingletonInstance(sdk); // When - CastleContext context = Castle.instance().contextBuilder() + CastleContext context = sdk.contextBuilder() .ip("1.1.1.1") .userAgent("Mozilla/5.0") .clientId("") @@ -49,7 +48,7 @@ public CastleTrackHttpTest() { // And a mock Request HttpServletRequest request = new MockHttpServletRequest(); - // And an track request is made + // And a track request is made sdk.onRequest(request).track(CastleMessage.builder("$login.succeeded") .userId("12345") .context(context)