Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jshaughn committed Jul 28, 2015
1 parent 8d6888d commit 7aaba6d
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void jsonToAlertTest() throws Exception {
@Test
public void jsonAvailabilityConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\"," +
"\"type\":\"AVAILABILITY\"," +
"\"type\":\"AVAILABILITY\",\"conditionSetSize\":1,\"conditionSetIndex\":1," +
"\"conditionId\":\"test-FIRING-1-1\",\"dataId\":\"Default\",\"operator\":\"UP\"}";
AvailabilityCondition condition = objectMapper.readValue(str, AvailabilityCondition.class);

Expand All @@ -209,7 +209,7 @@ public void jsonAvailabilityConditionTest() throws Exception {

String output = objectMapper.writeValueAsString(condition);

assertTrue(str.equals(output));
assertTrue(output, str.equals(output));

// Check bad mode and operator

Expand Down Expand Up @@ -274,7 +274,7 @@ public void jsonAvailabilityConditionEvalTest() throws Exception {
@Test
public void jsonCompareConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\",\"type\":\"COMPARE\"," +
"\"conditionId\":\"test-FIRING-1-1\"," +
"\"conditionSetSize\":1,\"conditionSetIndex\":1,\"conditionId\":\"test-FIRING-1-1\"," +
"\"dataId\":\"Default1\",\"operator\":\"LT\",\"data2Id\":\"Default2\",\"data2Multiplier\":1.2}";
CompareCondition condition = objectMapper.readValue(str, CompareCondition.class);

Expand All @@ -288,7 +288,7 @@ public void jsonCompareConditionTest() throws Exception {

String output = objectMapper.writeValueAsString(condition);

assertTrue(str.equals(output));
assertTrue(output, str.equals(output));

// Check bad mode and operator

Expand Down Expand Up @@ -385,7 +385,7 @@ public void jsonCompareConditionEvalTest() throws Exception {
@Test
public void jsonStringConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\",\"type\":\"STRING\"," +
"\"conditionId\":\"test-FIRING-1-1\"," +
"\"conditionSetSize\":1,\"conditionSetIndex\":1,\"conditionId\":\"test-FIRING-1-1\"," +
"\"dataId\":\"Default\",\"operator\":\"MATCH\",\"pattern\":\"test-pattern\",\"ignoreCase\":false}";
StringCondition condition = objectMapper.readValue(str, StringCondition.class);

Expand All @@ -399,7 +399,7 @@ public void jsonStringConditionTest() throws Exception {

String output = objectMapper.writeValueAsString(condition);

assertTrue(str.equals(output));
assertTrue(output, str.equals(output));

// Check bad mode and operator

Expand Down Expand Up @@ -491,7 +491,7 @@ public void jsonStringConditionEvalTest() throws Exception {
@Test
public void jsonThresholdConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\"," +
"\"type\":\"THRESHOLD\"," +
"\"type\":\"THRESHOLD\",\"conditionSetSize\":1,\"conditionSetIndex\":1," +
"\"conditionId\":\"test-FIRING-1-1\"," +
"\"dataId\":\"Default\",\"operator\":\"LT\",\"threshold\":10.5}";
ThresholdCondition condition = objectMapper.readValue(str, ThresholdCondition.class);
Expand All @@ -505,7 +505,7 @@ public void jsonThresholdConditionTest() throws Exception {

String output = objectMapper.writeValueAsString(condition);

assertTrue(str.equals(output));
assertTrue(output, str.equals(output));

// Check bad mode and operator

Expand Down Expand Up @@ -585,8 +585,8 @@ public void jsonThresholdConditionEvalTest() throws Exception {
@Test
public void jsonThresholdRangeConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\",\"type\":\"RANGE\"," +
"\"conditionId\":\"test-FIRING-1-1\",\"dataId\":\"Default\",\"operatorLow\":\"INCLUSIVE\"," +
"\"operatorHigh\":\"INCLUSIVE\"," +
"\"conditionSetSize\":1,\"conditionSetIndex\":1,\"conditionId\":\"test-FIRING-1-1\"," +
"\"dataId\":\"Default\",\"operatorLow\":\"INCLUSIVE\",\"operatorHigh\":\"INCLUSIVE\"," +
"\"thresholdLow\":10.5,\"thresholdHigh\":20.5,\"inRange\":true}";
ThresholdRangeCondition condition = objectMapper.readValue(str, ThresholdRangeCondition.class);

Expand All @@ -601,7 +601,7 @@ public void jsonThresholdRangeConditionTest() throws Exception {

String output = objectMapper.writeValueAsString(condition);

assertTrue(str.equals(output));
assertTrue(output, str.equals(output));

// Check bad mode and operator

Expand Down Expand Up @@ -728,8 +728,8 @@ public void jsonThresholdRangeConditionEvalTest() throws Exception {
@Test
public void jsonExternalConditionTest() throws Exception {
String str = "{\"tenantId\":\"test\",\"triggerId\":\"test\",\"triggerMode\":\"FIRING\","
+ "\"type\":\"EXTERNAL\", \"conditionId\":\"test-FIRING-1-1\","
+ "\"dataId\":\"Default\",\"systemId\":\"HawkularMetrics\","
+ "\"type\":\"EXTERNAL\", \"conditionId\":\"test-FIRING-1-1\",\"conditionSetSize\":1,"
+ "\"conditionSetIndex\":1,\"dataId\":\"Default\",\"systemId\":\"HawkularMetrics\","
+ "\"expression\":\"metric:5:avg(foo > 100.5)\"}";
ExternalCondition condition = objectMapper.readValue(str, ExternalCondition.class);

Expand Down

0 comments on commit 7aaba6d

Please sign in to comment.