KarafReleaseLiquibaseLockCommand implements Action { @Override public Object execute() throws Exception { DataSource datasource = ukelonn.getDataSource(); UkelonnLiquibase liquibase = new UkelonnLiquibase(); try (Connection connection = datasource.getConnection()) { liquibase.forceReleaseLocks(connection); } System.out.println("Forcibly unlocked the Liquibase changelog lock"); return null; }  @Override Object execute();  }
@Test public void testExecuteNullDatabaseOsgiService() throws Exception { KarafReleaseLiquibaseLockCommand action = new KarafReleaseLiquibaseLockCommand(); try { action.execute(); fail("Expected a NullPointerExceptio to be thrown"); } catch (NullPointerException e) { } }
@Test public void testExecute() throws Exception { KarafReleaseLiquibaseLockCommand action = new KarafReleaseLiquibaseLockCommand(); UkelonnService ukelonn = getUkelonnServiceSingleton(); setInternalState(action, "ukelonn", ukelonn); Object result = action.execute(); assertNull(result); }