Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CollectiveHealth-gists/d4561e85fee1f3bc82182a91616b0199 to your computer and use it in GitHub Desktop.
Save CollectiveHealth-gists/d4561e85fee1f3bc82182a91616b0199 to your computer and use it in GitHub Desktop.
Testing with real instance of SoundSystem, but mocked out DisplaySystem.
public class IntegrationWithSoundSystemTest {
@Test
public void testSoundSystem() {
Injector injector = Guice.createInjector(new ComputerTestModule()
.withInstance(SoundSystem.class, new SoundSystem()));
Computer computer = injector.getInstance(Computer.class);
// We will be satisfied with no exception being thrown
computer.playTestSound();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment