refactoring: tests add sgErrorNotFound

This commit is contained in:
nickAS21 2022-07-06 14:03:33 +03:00
parent 1e1f8edb1f
commit f2dd904522
4 changed files with 6 additions and 4 deletions

View File

@ -63,6 +63,7 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest {
protected final String msgErrorPermission = "You don't have permission to perform this operation!"; protected final String msgErrorPermission = "You don't have permission to perform this operation!";
protected final String msgErrorShouldBeSpecified = "should be specified"; protected final String msgErrorShouldBeSpecified = "should be specified";
protected final String msgErrorNotFound = "Requested item wasn't found!";
protected void testNotifyEntityAllOneTime(HasName entity, EntityId entityId, EntityId originatorId, protected void testNotifyEntityAllOneTime(HasName entity, EntityId entityId, EntityId originatorId,

View File

@ -354,7 +354,7 @@ public abstract class BaseEntityRelationControllerTest extends AbstractControlle
doDelete(url) doDelete(url)
.andExpect(status().isNotFound()) .andExpect(status().isNotFound())
.andExpect(statusReason(containsString("Requested item wasn't found!"))); .andExpect(statusReason(containsString(msgErrorNotFound)));
testNotifyEntityNever(mainDevice.getId(), null); testNotifyEntityNever(mainDevice.getId(), null);
} }
@ -376,7 +376,7 @@ public abstract class BaseEntityRelationControllerTest extends AbstractControlle
doDelete(url) doDelete(url)
.andExpect(status().isNotFound()) .andExpect(status().isNotFound())
.andExpect(statusReason(containsString("Requested item wasn't found!"))); .andExpect(statusReason(containsString(msgErrorNotFound)));
testNotifyEntityNever(mainDevice.getId(), null); testNotifyEntityNever(mainDevice.getId(), null);
} }

View File

@ -164,7 +164,7 @@ public abstract class BaseEntityViewControllerTest extends AbstractControllerTes
doGet("/api/tenant/entityViews?entityViewName=" + name) doGet("/api/tenant/entityViews?entityViewName=" + name)
.andExpect(status().isNotFound()) .andExpect(status().isNotFound())
.andExpect(statusReason(containsString("Requested item wasn't found!"))); .andExpect(statusReason(containsString(msgErrorNotFound)));
} }
@Test @Test

View File

@ -304,7 +304,8 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes
ActionType.DELETED, savedFirmwareInfo.getId().getId().toString()); ActionType.DELETED, savedFirmwareInfo.getId().getId().toString());
doGet("/api/otaPackage/info/" + savedFirmwareInfo.getId().getId().toString()) doGet("/api/otaPackage/info/" + savedFirmwareInfo.getId().getId().toString())
.andExpect(status().isNotFound()); .andExpect(status().isNotFound())
.andExpect(statusReason(containsString(msgErrorNotFound)));
} }
@Test @Test