test_class.declarator: migrationRepository
test_class.modifier: private
test_class.original_string: private MigrationRepository migrationRepository;
test_class.type: MigrationRepository
test_class.var_name: migrationRepository
test_class.file: cassandra-migration/src/test/java/org/cognitor/cassandra/migration/MigrationRepositoryTest.java
test_class.identifier: MigrationRepositoryTest
test_case.body: @Test
      public void shouldReturnOneScriptWhenRequestForAllScriptsSinceVersionTwoGiven() {
          List<DbMigration> scripts = migrationRepository.getMigrationsSinceVersion(2);
          assertThat(scripts.size(), is(equalTo(1)));
          assertThat(scripts.get(0).getVersion(), is(equalTo(3)));
      }
test_case.class_method_signature: MigrationRepositoryTest.shouldReturnOneScriptWhenRequestForAllScriptsSinceVersionTwoGiven()
test_case.full_signature: @Test public void shouldReturnOneScriptWhenRequestForAllScriptsSinceVersionTwoGiven()
test_case.identifier: shouldReturnOneScriptWhenRequestForAllScriptsSinceVersionTwoGiven
test_case.invocations: getMigrationsSinceVersion assertThat size is equalTo assertThat getVersion get is equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnOneScriptWhenRequestForAllScriptsSinceVersionTwoGiven()
focal_class.declarator: DEFAULT_SCRIPT_PATH = "cassandra/migration"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_SCRIPT_PATH = "cassandra/migration";
focal_class.type: String
focal_class.var_name: DEFAULT_SCRIPT_PATH
focal_class.declarator: SCRIPT_EXTENSION = ".cql"
focal_class.modifier: public static final
focal_class.original_string: public static final String SCRIPT_EXTENSION = ".cql";
focal_class.type: String
focal_class.var_name: SCRIPT_EXTENSION
focal_class.declarator: SCRIPT_ENCODING = "UTF-8"
focal_class.modifier: public static final
focal_class.original_string: public static final String SCRIPT_ENCODING = "UTF-8";
focal_class.type: String
focal_class.var_name: SCRIPT_ENCODING
focal_class.declarator: VERSION_NAME_DELIMITER = "_"
focal_class.modifier: public static final
focal_class.original_string: public static final String VERSION_NAME_DELIMITER = "_";
focal_class.type: String
focal_class.var_name: VERSION_NAME_DELIMITER
focal_class.declarator: SINGLE_LINE_COMMENT_PATTERN = "(^\\s*--.*)|(^\\s*//.*)"
focal_class.modifier: public static final
focal_class.original_string: public static final String SINGLE_LINE_COMMENT_PATTERN = "(^\\s*--.*)|(^\\s*//.*)";
focal_class.type: String
focal_class.var_name: SINGLE_LINE_COMMENT_PATTERN
focal_class.declarator: LOGGER = LoggerFactory.getLogger(MigrationRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(MigrationRepository.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: EXTRACT_VERSION_ERROR_MSG = "Error for script %s. Unable to extract version."
focal_class.modifier: private static final
focal_class.original_string: private static final String EXTRACT_VERSION_ERROR_MSG = "Error for script %s. Unable to extract version.";
focal_class.type: String
focal_class.var_name: EXTRACT_VERSION_ERROR_MSG
focal_class.declarator: SCANNING_SCRIPT_FOLDER_ERROR_MSG = "Error while scanning script folder for new scripts."
focal_class.modifier: private static final
focal_class.original_string: private static final String SCANNING_SCRIPT_FOLDER_ERROR_MSG = "Error while scanning script folder for new scripts.";
focal_class.type: String
focal_class.var_name: SCANNING_SCRIPT_FOLDER_ERROR_MSG
focal_class.declarator: READING_SCRIPT_ERROR_MSG = "Error while reading script %s"
focal_class.modifier: private static final
focal_class.original_string: private static final String READING_SCRIPT_ERROR_MSG = "Error while reading script %s";
focal_class.type: String
focal_class.var_name: READING_SCRIPT_ERROR_MSG
focal_class.declarator: PATH_SEPARATOR_CHAR = "/"
focal_class.modifier: private static final
focal_class.original_string: private static final String PATH_SEPARATOR_CHAR = "/";
focal_class.type: String
focal_class.var_name: PATH_SEPARATOR_CHAR
focal_class.declarator: commentPattern
focal_class.modifier: private final
focal_class.original_string: private final Pattern commentPattern;
focal_class.type: Pattern
focal_class.var_name: commentPattern
focal_class.declarator: scannerRegistry
focal_class.modifier: private final
focal_class.original_string: private final ScannerRegistry scannerRegistry;
focal_class.type: ScannerRegistry
focal_class.var_name: scannerRegistry
focal_class.declarator: migrationScripts
focal_class.modifier: private
focal_class.original_string: private List<ScriptFile> migrationScripts;
focal_class.type: List<ScriptFile>
focal_class.var_name: migrationScripts
focal_class.declarator: scriptCollector
focal_class.modifier: private final
focal_class.original_string: private final ScriptCollector scriptCollector;
focal_class.type: ScriptCollector
focal_class.var_name: scriptCollector
focal_class.declarator: scriptFilter = new NoOpFilter()
focal_class.modifier: private
focal_class.original_string: private ScriptFilter scriptFilter = new NoOpFilter();
focal_class.type: ScriptFilter
focal_class.var_name: scriptFilter
focal_class.file: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationRepository.java
focal_class.identifier: MigrationRepository
focal_class.class_method_signature: MigrationRepository.MigrationRepository()
focal_class.full_signature: public  MigrationRepository()
focal_class.identifier: MigrationRepository
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  MigrationRepository()
focal_class.class_method_signature: MigrationRepository.MigrationRepository(String scriptPath)
focal_class.full_signature: public  MigrationRepository(String scriptPath)
focal_class.identifier: MigrationRepository
focal_class.modifiers: public
focal_class.parameters: (String scriptPath)
focal_class.signature:  MigrationRepository(String scriptPath)
focal_class.class_method_signature: MigrationRepository.MigrationRepository(String scriptPath, ScriptCollector scriptCollector)
focal_class.full_signature: public  MigrationRepository(String scriptPath, ScriptCollector scriptCollector)
focal_class.identifier: MigrationRepository
focal_class.modifiers: public
focal_class.parameters: (String scriptPath, ScriptCollector scriptCollector)
focal_class.signature:  MigrationRepository(String scriptPath, ScriptCollector scriptCollector)
focal_class.class_method_signature: MigrationRepository.MigrationRepository(String scriptPath, ScriptCollector scriptCollector, ScannerRegistry scannerRegistry)
focal_class.full_signature: public  MigrationRepository(String scriptPath, ScriptCollector scriptCollector, ScannerRegistry scannerRegistry)
focal_class.identifier: MigrationRepository
focal_class.modifiers: public
focal_class.parameters: (String scriptPath, ScriptCollector scriptCollector, ScannerRegistry scannerRegistry)
focal_class.signature:  MigrationRepository(String scriptPath, ScriptCollector scriptCollector, ScannerRegistry scannerRegistry)
focal_class.class_method_signature: MigrationRepository.setScriptFilter(ScriptFilter scriptFilter)
focal_class.full_signature: public void setScriptFilter(ScriptFilter scriptFilter)
focal_class.identifier: setScriptFilter
focal_class.modifiers: public
focal_class.parameters: (ScriptFilter scriptFilter)
focal_class.return: void
focal_class.signature: void setScriptFilter(ScriptFilter scriptFilter)
focal_class.class_method_signature: MigrationRepository.normalizePath(String scriptPath)
focal_class.full_signature: private String normalizePath(String scriptPath)
focal_class.identifier: normalizePath
focal_class.modifiers: private
focal_class.parameters: (String scriptPath)
focal_class.return: String
focal_class.signature: String normalizePath(String scriptPath)
focal_class.class_method_signature: MigrationRepository.getLatestVersion()
focal_class.full_signature: public int getLatestVersion()
focal_class.identifier: getLatestVersion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getLatestVersion()
focal_class.class_method_signature: MigrationRepository.scanForScripts(String scriptPath)
focal_class.full_signature: private List<ScriptFile> scanForScripts(String scriptPath)
focal_class.identifier: scanForScripts
focal_class.modifiers: private
focal_class.parameters: (String scriptPath)
focal_class.return: List<ScriptFile>
focal_class.signature: List<ScriptFile> scanForScripts(String scriptPath)
focal_class.class_method_signature: MigrationRepository.extractScriptVersion(String scriptName)
focal_class.full_signature: private static int extractScriptVersion(String scriptName)
focal_class.identifier: extractScriptVersion
focal_class.modifiers: private static
focal_class.parameters: (String scriptName)
focal_class.return: int
focal_class.signature: int extractScriptVersion(String scriptName)
focal_class.class_method_signature: MigrationRepository.isMigrationScript(String resource)
focal_class.full_signature: private static boolean isMigrationScript(String resource)
focal_class.identifier: isMigrationScript
focal_class.modifiers: private static
focal_class.parameters: (String resource)
focal_class.return: boolean
focal_class.signature: boolean isMigrationScript(String resource)
focal_class.class_method_signature: MigrationRepository.extractScriptName(String resourceName)
focal_class.full_signature: private String extractScriptName(String resourceName)
focal_class.identifier: extractScriptName
focal_class.modifiers: private
focal_class.parameters: (String resourceName)
focal_class.return: String
focal_class.signature: String extractScriptName(String resourceName)
focal_class.class_method_signature: MigrationRepository.getMigrationsSinceVersion(int version)
focal_class.full_signature: public List<DbMigration> getMigrationsSinceVersion(int version)
focal_class.identifier: getMigrationsSinceVersion
focal_class.modifiers: public
focal_class.parameters: (int version)
focal_class.return: List<DbMigration>
focal_class.signature: List<DbMigration> getMigrationsSinceVersion(int version)
focal_class.class_method_signature: MigrationRepository.loadScriptContent(ScriptFile script)
focal_class.full_signature: private String loadScriptContent(ScriptFile script)
focal_class.identifier: loadScriptContent
focal_class.modifiers: private
focal_class.parameters: (ScriptFile script)
focal_class.return: String
focal_class.signature: String loadScriptContent(ScriptFile script)
focal_class.class_method_signature: MigrationRepository.readResourceFileAsString(String resourceName, ClassLoader classLoader)
focal_class.full_signature: private String readResourceFileAsString(String resourceName, ClassLoader classLoader)
focal_class.identifier: readResourceFileAsString
focal_class.modifiers: private
focal_class.parameters: (String resourceName, ClassLoader classLoader)
focal_class.return: String
focal_class.signature: String readResourceFileAsString(String resourceName, ClassLoader classLoader)
focal_class.class_method_signature: MigrationRepository.isLineComment(String line)
focal_class.full_signature: private boolean isLineComment(String line)
focal_class.identifier: isLineComment
focal_class.modifiers: private
focal_class.parameters: (String line)
focal_class.return: boolean
focal_class.signature: boolean isLineComment(String line)
focal_method.body: public List<DbMigration> getMigrationsSinceVersion(int version) {
          List<DbMigration> dbMigrations = new ArrayList<>();
          migrationScripts.stream().filter(script -> script.getVersion() > version).forEach(script -> {
              String content = loadScriptContent(script);
              String updatedContent = scriptFilter.filter(content);
              dbMigrations.add(new DbMigration(script.getScriptName(), script.getVersion(), updatedContent));
          });
          return dbMigrations;
      }
focal_method.class_method_signature: MigrationRepository.getMigrationsSinceVersion(int version)
focal_method.full_signature: public List<DbMigration> getMigrationsSinceVersion(int version)
focal_method.identifier: getMigrationsSinceVersion
focal_method.invocations: forEach filter stream getVersion loadScriptContent filter add getScriptName getVersion
focal_method.modifiers: public
focal_method.parameters: (int version)
focal_method.return: List<DbMigration>
focal_method.signature: List<DbMigration> getMigrationsSinceVersion(int version)