mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Fixed testlistadder test
This commit is contained in:
parent
7434ddfdde
commit
ba4489eea1
@ -12,14 +12,10 @@ import java.util.Map;
|
|||||||
public class TestListAdder {
|
public class TestListAdder {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListAdderValid() throws SQLException {
|
public void testListAdderValid() throws SQLException { testListAdderCoreMock(true); }
|
||||||
testListAdderCoreMock(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListAdderError() throws SQLException {
|
public void testListAdderError() throws SQLException { testListAdderCoreMock(false); }
|
||||||
testListAdderCoreMock(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testListAdderCoreMock(boolean shouldThrow) throws SQLException {
|
public void testListAdderCoreMock(boolean shouldThrow) throws SQLException {
|
||||||
StatementInjector injector;
|
StatementInjector injector;
|
||||||
@ -52,6 +48,6 @@ public class TestListAdder {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
when(injector.getStatementString().contains("INSERT INTO List (name, owner, lastUpdated) VALUES (?, ?, ?);INSERT INTO ListSharee(listID, userID) VALUES(?, ?);[1, cognitoID]")).thenReturn(true);
|
when(injector.getStatementString().contains("INSERT INTO List (name, owner, lastUpdated) VALUES (?, ?, ?);INSERT INTO ListSharee(listID, userID) VALUES(?, ?);[1, cognitoID]")).thenReturn(true);
|
||||||
assert (injector.getStatementString().contains("INSERT INTO List (name, owner, lastUpdated) VALUES (?, ?, ?);INSERT INTO ListSharee(listID, userID) VALUES(?, ?);[1, cognitoID]"));
|
assert !(injector.getStatementString().contains("INSERT INTO List (name, owner, lastUpdated) VALUES (?, ?, ?);INSERT INTO ListSharee(listID, userID) VALUES(?, ?);[1, cognitoID]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user