Enable REST tests

Enable REST tests again after core support for 3rd party REST tests
was added back.

Closes elastic/elasticsearch#599

Original commit: elastic/x-pack-elasticsearch@a5fffbca6e
This commit is contained in:
Simon Willnauer 2015-06-17 20:52:16 +02:00
parent 483fc360f4
commit e96eab8ba0
2 changed files with 4 additions and 8 deletions

View File

@ -26,7 +26,7 @@
<license.plugin.version>2.0.0-SNAPSHOT</license.plugin.version> <license.plugin.version>2.0.0-SNAPSHOT</license.plugin.version>
<shield.plugin.version>2.0.0-SNAPSHOT</shield.plugin.version> <shield.plugin.version>2.0.0-SNAPSHOT</shield.plugin.version>
<tests.security.manager>false</tests.security.manager> <!-- some tests fail since they need setFactory permission --> <tests.security.manager>false</tests.security.manager> <!-- some tests fail since they need setFactory permission -->
<tests.rest>false</tests.rest> <!-- watcher can't run REST tests at this point --> <tests.rest.load_packaged>false</tests.rest.load_packaged>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -6,6 +6,7 @@
package org.elasticsearch.watcher.test.rest; package org.elasticsearch.watcher.test.rest;
import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.Name;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.plugin.core.LicenseExpiredException; import org.elasticsearch.license.plugin.core.LicenseExpiredException;
@ -47,13 +48,8 @@ public class WatcherDisabledLicenseRestTests extends WatcherRestTests {
//This was a test testing the "hijacked" methods //This was a test testing the "hijacked" methods
return; return;
} }
if (shieldEnabled) { assertThat(ae.getMessage(), containsString("license expired for feature [watcher]"));
assertThat(ae.getMessage(), containsString("returned [403 Forbidden]")); assertThat(ae.getMessage(), containsString(Strings.toUnderscoreCase(LicenseExpiredException.class.getSimpleName())));
assertThat(ae.getMessage(), containsString("is unauthorized for user [admin]"));
} else {
assertThat(ae.getMessage(), containsString("unauthorized"));
assertThat(ae.getMessage(), containsString(LicenseExpiredException.class.getSimpleName()));
}
} }
} }