yifan-c commented on code in PR #47: URL: https://github.com/apache/cassandra-sidecar/pull/47#discussion_r1220467422
########## src/test/java/org/apache/cassandra/sidecar/MainModuleTest.java: ########## @@ -0,0 +1,25 @@ +package org.apache.cassandra.sidecar; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.name.Names; +import com.google.inject.util.Modules; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Unit tests for the {@link MainModule} class + */ +public class MainModuleTest { + @Test + public void testSidecarVersion() + { + Injector injector = Guice.createInjector(Modules.override(new MainModule()).with(new TestModule())); + + String sidecarVersion = injector.getInstance(Key.get(String.class, Names.named("SidecarVersion"))); + + assertEquals("1.0-TEST", sidecarVersion); Review Comment: Thanks for adding the test, but it does not run successfully. This is the result I get ``` org.opentest4j.AssertionFailedError: expected: <1.0-TEST> but was: <1.0-SNAPSHOT> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197) at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182) at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177) at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1142) at org.apache.cassandra.sidecar.MainModuleTest.testSidecarVersion(MainModuleTest.java:23) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org