Use javax annotation for validation

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-02-10 16:51:45 +01:00
parent f78bd68c03
commit 46a71c1b3a
3 changed files with 12 additions and 8 deletions

View File

@@ -68,13 +68,20 @@ public class TargetManagementTest extends AbstractIntegrationTest {
@Test
@Description("Verify that a target with empty controller id cannot be created")
public void createTarget() {
public void createTargetWithNoControllerId() {
try {
targetManagement.createTarget(new Target(""));
fail("target with empty controller id should not be created");
} catch (final ConstraintViolationException e) {
// ok
}
try {
targetManagement.createTarget(new Target(null));
fail("target with empty controller id should not be created");
} catch (final ConstraintViolationException e) {
// ok
}
}
@Test