public ModuleInputComponentStore(InputModule module, InputComponentStore inputComponentStore, SensorStrategy strategy) { this.moduleKey = module.key(); this.inputComponentStore = inputComponentStore; this.strategy = strategy; }
private ModuleInputComponentStore newModuleInputComponentStore() { InputModule module = mock(InputModule.class); when(module.key()).thenReturn("moduleKey"); return new ModuleInputComponentStore(module, componentStore, mock(SensorStrategy.class)); }
@Test public void should_find_module_components_with_non_global_strategy() { InputComponentStore inputComponentStore = mock(InputComponentStore.class); SensorStrategy strategy = new SensorStrategy(); InputModule module = mock(InputModule.class); when(module.key()).thenReturn("foo"); ModuleInputComponentStore store = new ModuleInputComponentStore(module, inputComponentStore, strategy); strategy.setGlobal(false); store.inputFiles(); verify(inputComponentStore).filesByModule("foo"); String relativePath = "somepath"; store.inputFile(relativePath); verify(inputComponentStore).getFile(any(String.class), eq(relativePath)); store.languages(); verify(inputComponentStore).languages(any(String.class)); }
private DefaultInputFile setupFile(String path) { return new TestInputFileBuilder(context.module().key(), path) .setLanguage("bla") .setType(InputFile.Type.TEST) .initMetadata("1\n2\n3\n4\n5\n6") .build(); }
private DefaultInputFile setupFile(String path) { return new TestInputFileBuilder(context.module().key(), path) .setLanguage("bla") .setType(InputFile.Type.TEST) .initMetadata("1\n2\n3\n4\n5\n6") .build(); } }
public ModuleInputComponentStore(InputModule module, InputComponentStore inputComponentStore, SensorStrategy strategy) { this.moduleKey = module.key(); this.inputComponentStore = inputComponentStore; this.strategy = strategy; }