Browse Source

refactoring: tests add sgErrorNotFound

pull/6899/head
nickAS21 4 years ago
parent
commit
f2dd904522
  1. 1
      application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java
  2. 4
      application/src/test/java/org/thingsboard/server/controller/BaseEntityRelationControllerTest.java
  3. 2
      application/src/test/java/org/thingsboard/server/controller/BaseEntityViewControllerTest.java
  4. 3
      application/src/test/java/org/thingsboard/server/controller/BaseOtaPackageControllerTest.java

1
application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java

@ -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 msgErrorShouldBeSpecified = "should be specified";
protected final String msgErrorNotFound = "Requested item wasn't found!";
protected void testNotifyEntityAllOneTime(HasName entity, EntityId entityId, EntityId originatorId,

4
application/src/test/java/org/thingsboard/server/controller/BaseEntityRelationControllerTest.java

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

2
application/src/test/java/org/thingsboard/server/controller/BaseEntityViewControllerTest.java

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

3
application/src/test/java/org/thingsboard/server/controller/BaseOtaPackageControllerTest.java

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

Loading…
Cancel
Save