diff options
Diffstat (limited to 'rulemgt/src/test/java')
-rw-r--r-- | rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java | 58 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java | 33 |
2 files changed, 91 insertions, 0 deletions
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java b/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java new file mode 100644 index 0000000..3f5469d --- /dev/null +++ b/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java @@ -0,0 +1,58 @@ +/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openo.holmes.rulemgt.bean.request;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class RuleCreateRequestTest {
+
+ @Test
+ public void getterAndSetter4RuleName(){
+ final String rulename = "rulename";
+ RuleCreateRequest ruleCreateRequest = new RuleCreateRequest();
+ ruleCreateRequest.setRuleName(rulename);
+ assertThat(ruleCreateRequest.getRuleName(), equalTo(rulename));
+ }
+
+ @Test
+ public void getterAndSetter4Description(){
+ final String description = "desc";
+ RuleCreateRequest ruleCreateRequest = new RuleCreateRequest();
+ ruleCreateRequest.setDescription(description);
+ assertThat(ruleCreateRequest.getDescription(), equalTo(description));
+ }
+
+ @Test
+ public void getterAndSetter4Content(){
+ final String contents = "contents";
+ RuleCreateRequest ruleCreateRequest = new RuleCreateRequest();
+ ruleCreateRequest.setContent(contents);
+ assertThat(ruleCreateRequest.getContent(), equalTo(contents));
+ }
+
+ @Test
+ public void getterAndSetter4Enabled(){
+ final int enabled = 0;
+ RuleCreateRequest ruleCreateRequest = new RuleCreateRequest();
+ ruleCreateRequest.setEnabled(enabled);
+ assertThat(ruleCreateRequest.getEnabled(), is(enabled));
+ }
+}
\ No newline at end of file diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java b/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java new file mode 100644 index 0000000..f9a09ff --- /dev/null +++ b/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java @@ -0,0 +1,33 @@ +/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openo.holmes.rulemgt.bean.request;
+
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+
+public class RuleDeleteRequestTest {
+ @Test
+ public void getterAndSetter4RuleId(){
+ final String ruleId = "ruleId";
+ RuleDeleteRequest ruleDeleteRequest = new RuleDeleteRequest();
+ ruleDeleteRequest.setRuleId(ruleId);
+ assertThat(ruleDeleteRequest.getRuleId(), equalTo(ruleId));
+ }
+}
\ No newline at end of file |