1 package liquibase.change.core;
2
3 import liquibase.change.AbstractChangeTest;
4 import liquibase.database.Database;
5 import liquibase.database.core.SQLiteDatabase;
6 import static org.junit.Assert.*;
7 import org.junit.Test;
8
9 public class AddUniqueConstraintChangeTest extends AbstractChangeTest {
10
11 @Override
12 @Test
13 public void getRefactoringName() throws Exception {
14 assertEquals("Add Unique Constraint", new AddUniqueConstraintChange().getChangeMetaData().getDescription());
15 }
16
17 @Override
18 @Test
19 public void generateStatement() throws Exception {
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 }
43
44 @Override
45 @Test
46 public void getConfirmationMessage() throws Exception {
47 AddUniqueConstraintChange change = new AddUniqueConstraintChange();
48 change.setTableName("TABLE_NAME");
49 change.setColumnNames("COL_HERE");
50
51 assertEquals("Unique constraint added to TABLE_NAME(COL_HERE)", change.getConfirmationMessage());
52 }
53
54 @Override
55 protected boolean changeIsUnsupported(Database database) {
56 return database instanceof SQLiteDatabase;
57 }
58 }