assertEquals(Integer.valueOf(toWeight), from.getWeight());
}
@Test(expected = IllegalStateException.class)
public void testDownWithNotEnough() {
Move first = createMove(); //1000
Move to = createMove(); //2000
for (int i = 0; i < 25; i++) {
createMove();
}
Move from = createMove();
Integer fromWeight = from.getWeight();
Integer toWeight = to.getWeight();
Integer firstWeight = first.getWeight();
first.setWeight(toWeight - 1);
moveService.update(first);
flush();
moveService.down(from.getId(), to.getId());
from = moveService.findOne(from.getId());
assertEquals(toWeight, from.getWeight());
}