You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2019/09/30 18:08:21 UTC
[jmeter] branch master updated: Use more hamcrest matchers and use
static import
This is an automated email from the ASF dual-hosted git repository.
fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git
The following commit(s) were added to refs/heads/master by this push:
new 1104184 Use more hamcrest matchers and use static import
1104184 is described below
commit 11041840bd8fe48663ca4fef4bb716cadb16b8a1
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Mon Sep 30 20:07:00 2019 +0200
Use more hamcrest matchers and use static import
Take Vladimirs comment into account and use a better suited
matcher to check for empty/non-empty collections
---
.../org/apache/jmeter/protocol/http/parser/TestCssParser.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestCssParser.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestCssParser.java
index 17190d4..aa0f9c3 100644
--- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestCssParser.java
+++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestCssParser.java
@@ -18,6 +18,9 @@
package org.apache.jmeter.protocol.http.parser;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertThat;
import java.net.MalformedURLException;
@@ -45,19 +48,19 @@ public class TestCssParser extends JMeterTestCase {
public void testGetEmbeddedResourceURLsNoUrls() throws Exception {
CssParser nonIgnoreParser = new CssParser();
List<?> result = extractUrls(nonIgnoreParser, "..");
- assertThat(result.isEmpty(), CoreMatchers.is(true));
+ assertThat(result, is(empty()));
}
@Test
public void testGetEmbeddedResourceURLsnOneUrl() throws Exception {
List<?> result = extractUrls("@import url(http://example.com/abc.css);");
- assertThat(result.isEmpty(), CoreMatchers.is(false));
+ assertThat(result, is(not(empty())));
}
@Test
public void testExtractUrlsFromBrokenData() throws Exception {
List<?> result = extractUrls(CSS_IN_ERROR);
- assertThat(result.isEmpty(), CoreMatchers.is(true));
+ assertThat(result, is(empty()));
}
@Test