mirror of https://github.com/apache/cloudstack.git
Fix the tests
Note to self, surefire actually runs with assertions enabled where junit inside eclipse doesn't. Sure surefire will mark tests as failed when an assertion is triggered. Take care when mocking stuff.
This commit is contained in:
parent
2b74b6e827
commit
9c8eba1da3
|
|
@ -161,6 +161,7 @@ public class NiciraNvpApiTest {
|
|||
when(header.getValue()).thenReturn("text/html");
|
||||
when(_method.getResponseHeader("Content-Type")).thenReturn(header);
|
||||
when(_method.getResponseBodyAsString()).thenReturn("Off to timbuktu, won't be back later.");
|
||||
when(_method.isRequestSent()).thenReturn(true);
|
||||
try {
|
||||
ls = _api.executeCreateObject(ls, LogicalSwitch.class, "/", Collections.<String, String> emptyMap());
|
||||
} finally {
|
||||
|
|
@ -204,6 +205,7 @@ public class NiciraNvpApiTest {
|
|||
when(header.getValue()).thenReturn("text/html");
|
||||
when(_method.getResponseHeader("Content-Type")).thenReturn(header);
|
||||
when(_method.getResponseBodyAsString()).thenReturn("Off to timbuktu, won't be back later.");
|
||||
when(_method.isRequestSent()).thenReturn(true);
|
||||
try {
|
||||
_api.executeUpdateObject(ls, "/", Collections.<String, String> emptyMap());
|
||||
} finally {
|
||||
|
|
@ -241,6 +243,7 @@ public class NiciraNvpApiTest {
|
|||
when(header.getValue()).thenReturn("text/html");
|
||||
when(_method.getResponseHeader("Content-Type")).thenReturn(header);
|
||||
when(_method.getResponseBodyAsString()).thenReturn("Off to timbuktu, won't be back later.");
|
||||
when(_method.isRequestSent()).thenReturn(true);
|
||||
try {
|
||||
_api.executeDeleteObject("/");
|
||||
} finally {
|
||||
|
|
@ -279,6 +282,7 @@ public class NiciraNvpApiTest {
|
|||
when(header.getValue()).thenReturn("text/html");
|
||||
when(_method.getResponseHeader("Content-Type")).thenReturn(header);
|
||||
when(_method.getResponseBodyAsString()).thenReturn("Off to timbuktu, won't be back later.");
|
||||
when(_method.isRequestSent()).thenReturn(true);
|
||||
try {
|
||||
_api.executeRetrieveObject(LogicalSwitch.class, "/", Collections.<String, String> emptyMap());
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue