Exemplo n.º 1
0
 @Test
 public void shouldDoNothingIfDatabaseHasAllMigrations() {
   mockery.checking(
       new Expectations() {
         {
           one(provider).getAppliedMigrations();
           will(returnValue(Arrays.asList("second", "first")));
         }
       });
   Migrations migrationsToApply = migrator.getMigrationsToApply();
   assertThat(migrationsToApply.size(), is(equalTo(0)));
   mockery.assertIsSatisfied();
 }
Exemplo n.º 2
0
 @Test
 public void shouldReturnNonExecutedMigrationsIfThereAreAnyPending() {
   mockery.checking(
       new Expectations() {
         {
           one(provider).getAppliedMigrations();
           will(returnValue(Arrays.asList("first")));
         }
       });
   Migrations migrationsToApply = migrator.getMigrationsToApply();
   assertThat(migrationsToApply.size(), is(equalTo(1)));
   assertThat(migrationsToApply.getAll().iterator().next(), is(equalTo(second)));
   mockery.assertIsSatisfied();
 }