Skip to content

Commit 9d47a0a

Browse files
committed
ContentSecurityPolicyHeaderWriterTest: use random values in test.
Addressed to #300
1 parent b245454 commit 9d47a0a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,13 @@
338338
<scope>test</scope>
339339
</dependency>
340340

341+
<dependency>
342+
<groupId>io.qala.datagen</groupId>
343+
<artifactId>qala-datagen</artifactId>
344+
<version>${datagen.version}</version>
345+
<scope>test</scope>
346+
</dependency>
347+
341348
<dependency>
342349
<groupId>junit</groupId>
343350
<artifactId>junit</artifactId>
@@ -469,6 +476,7 @@
469476
<compiler.plugin.version>3.6.1</compiler.plugin.version>
470477
<coveralls.plugin.version>2.2.0</coveralls.plugin.version>
471478
<cucumber.version>1.2.5</cucumber.version>
479+
<datagen.version>2.2.1</datagen.version>
472480

473481
<!-- Disable XML reports by default. Enabled manually by passing -DdisableXmlReport=false in CI environment -->
474482
<disableXmlReport>true</disableXmlReport>

src/test/java/ru/mystamps/web/support/spring/security/ContentSecurityPolicyHeaderWriterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import org.junit.Test;
2727

28+
import static io.qala.datagen.RandomShortApi.bool;
2829
import static org.hamcrest.MatcherAssert.assertThat;
2930
import static org.hamcrest.Matchers.arrayWithSize;
3031
import static org.hamcrest.Matchers.is;
@@ -43,8 +44,7 @@ public class ContentSecurityPolicyHeaderWriterTest {
4344

4445
@Test
4546
public void writeContentSecurityPolicyHeader() {
46-
boolean anyValue = false;
47-
ContentSecurityPolicyHeaderWriter writer = new ContentSecurityPolicyHeaderWriter(anyValue);
47+
ContentSecurityPolicyHeaderWriter writer = new ContentSecurityPolicyHeaderWriter(bool());
4848

4949
HttpServletRequest request = new MockHttpServletRequest();
5050
HttpServletResponse response = new MockHttpServletResponse();

0 commit comments

Comments
 (0)