-/*\r
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.groupbasedpolicy.resolver.validator;\r
-\r
-import static org.junit.Assert.assertEquals;\r
-import static org.junit.Assert.assertFalse;\r
-import static org.junit.Assert.assertTrue;\r
-\r
-import org.junit.Before;\r
-import org.junit.Rule;\r
-import org.junit.Test;\r
-import org.junit.rules.ExpectedException;\r
-import org.opendaylight.groupbasedpolicy.api.ValidationResult;\r
-import org.opendaylight.groupbasedpolicy.dto.ValidationResultBuilder;\r
-\r
-public class ValidationResultTest {\r
-\r
- @Rule\r
- public ExpectedException thrown = ExpectedException.none();\r
-\r
- public static final String VALIDATED = "Validated.";\r
- public static final String EMPTY_STRING = "";\r
-\r
- ValidationResultBuilder resultBuilder;\r
-\r
- @Before\r
- public void init() {\r
- resultBuilder = new ValidationResultBuilder();\r
- }\r
-\r
- @Test\r
- public void testBuild_WithSuccess() {\r
- ValidationResult result = resultBuilder.success().build();\r
- assertTrue(result.isValid());\r
- assertEquals(EMPTY_STRING, result.getMessage());\r
- }\r
-\r
- @Test\r
- public void testBuild_WithFailed() {\r
- ValidationResult result = resultBuilder.failed().build();\r
- assertFalse(result.isValid());\r
- assertEquals(EMPTY_STRING, result.getMessage());\r
- }\r
-\r
- @Test\r
- public void testMessage() {\r
- ValidationResult result = resultBuilder.setMessage(VALIDATED).build();\r
-\r
- assertEquals(VALIDATED, result.getMessage());\r
-\r
- thrown.expect(IllegalArgumentException.class);\r
- thrown.expectMessage(ValidationResultBuilder.ILLEGAL_ARG_EX_MSG);\r
- resultBuilder.setMessage(null);\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.groupbasedpolicy.resolver.validator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.opendaylight.groupbasedpolicy.api.ValidationResult;
+import org.opendaylight.groupbasedpolicy.dto.ValidationResultBuilder;
+
+public class ValidationResultTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ public static final String VALIDATED = "Validated.";
+ public static final String EMPTY_STRING = "";
+
+ ValidationResultBuilder resultBuilder;
+
+ @Before
+ public void init() {
+ resultBuilder = new ValidationResultBuilder();
+ }
+
+ @Test
+ public void testBuild_WithSuccess() {
+ ValidationResult result = resultBuilder.success().build();
+ assertTrue(result.isValid());
+ assertEquals(EMPTY_STRING, result.getMessage());
+ }
+
+ @Test
+ public void testBuild_WithFailed() {
+ ValidationResult result = resultBuilder.failed().build();
+ assertFalse(result.isValid());
+ assertEquals(EMPTY_STRING, result.getMessage());
+ }
+
+ @Test
+ public void testMessage() {
+ ValidationResult result = resultBuilder.setMessage(VALIDATED).build();
+
+ assertEquals(VALIDATED, result.getMessage());
+
+ thrown.expect(IllegalArgumentException.class);
+ thrown.expectMessage(ValidationResultBuilder.ILLEGAL_ARG_EX_MSG);
+ resultBuilder.setMessage(null);
+ }
+
+}