Skip to content

Commit 37dcc5a

Browse files
Polish.
1 parent 606c7d9 commit 37dcc5a

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

src/test/java/ac/simons/spring/boot/wro4j/Wro4jAutoConfigurationTests.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void processorsFactoryShouldWork() {
8181
assertThat(processorsFactory.getPreProcessors().iterator().next())
8282
.isInstanceOf(SemicolonAppenderPreProcessor.class);
8383
assertThat(processorsFactory.getPostProcessors()).hasSize(1);
84-
assertThat(((ProcessorDecorator) processorsFactory.getPostProcessors().iterator().next())
85-
.getDecoratedObject() instanceof JSMinProcessor).isTrue();
84+
assertThat(((ProcessorDecorator) processorsFactory.getPostProcessors().iterator().next()).getDecoratedObject())
85+
.isInstanceOf(JSMinProcessor.class);
8686

8787
wro4jProperties.setManagerFactory(null);
8888
processorsFactory = wro4jAutoConfiguration.processorsFactory(wro4jProperties);
@@ -91,7 +91,7 @@ void processorsFactoryShouldWork() {
9191
wro4jProperties.setPreProcessors(List.of(SemicolonAppenderPreProcessor.class));
9292
wro4jProperties.setPostProcessors(List.of(JSMinProcessor.class));
9393
processorsFactory = wro4jAutoConfiguration.processorsFactory(wro4jProperties);
94-
assertThat(processorsFactory instanceof SimpleProcessorsFactory).isTrue();
94+
assertThat(processorsFactory).isInstanceOf(SimpleProcessorsFactory.class);
9595
assertThat(processorsFactory.getPreProcessors()).hasSize(1);
9696
assertThat(processorsFactory.getPreProcessors().iterator().next())
9797
.isInstanceOf(SemicolonAppenderPreProcessor.class);
@@ -118,23 +118,23 @@ void wroFilterPropertiesShouldWork() {
118118
Properties p;
119119

120120
p = new Wro4jAutoConfiguration(this.applicationContext, Optional.empty()).wroFilterProperties(wro4jProperties);
121-
assertThat(p).containsEntry(ConfigConstants.debug.name(), "true");
122-
assertThat(p).containsEntry(ConfigConstants.minimizeEnabled.name(), "true");
123-
assertThat(p).containsEntry(ConfigConstants.gzipResources.name(), "true");
124-
assertThat(p).containsEntry(ConfigConstants.resourceWatcherUpdatePeriod.name(), "0");
125-
assertThat(p).containsEntry(ConfigConstants.resourceWatcherAsync.name(), "false");
126-
assertThat(p).containsEntry(ConfigConstants.cacheUpdatePeriod.name(), "0");
127-
assertThat(p).containsEntry(ConfigConstants.modelUpdatePeriod.name(), "0");
128-
assertThat(p).doesNotContainKey(ConfigConstants.header.name());
129-
assertThat(p).containsEntry(ConfigConstants.parallelPreprocessing.name(), "false");
130-
assertThat(p).containsEntry(ConfigConstants.connectionTimeout.name(), "2000");
131-
assertThat(p).containsEntry(ConfigConstants.encoding.name(), "UTF-8");
132-
assertThat(p).containsEntry(ConfigConstants.ignoreMissingResources.name(), "true");
133-
assertThat(p).containsEntry(ConfigConstants.ignoreEmptyGroup.name(), "true");
134-
assertThat(p).containsEntry(ConfigConstants.ignoreFailingProcessor.name(), "false");
135-
assertThat(p).containsEntry(ConfigConstants.cacheGzippedContent.name(), "true");
136-
assertThat(p).containsEntry(ConfigConstants.jmxEnabled.name(), "false");
137-
assertThat(p).doesNotContainKey(ConfigConstants.mbeanName.name());
121+
assertThat(p).containsEntry(ConfigConstants.debug.name(), "true")
122+
.containsEntry(ConfigConstants.minimizeEnabled.name(), "true")
123+
.containsEntry(ConfigConstants.gzipResources.name(), "true")
124+
.containsEntry(ConfigConstants.resourceWatcherUpdatePeriod.name(), "0")
125+
.containsEntry(ConfigConstants.resourceWatcherAsync.name(), "false")
126+
.containsEntry(ConfigConstants.cacheUpdatePeriod.name(), "0")
127+
.containsEntry(ConfigConstants.modelUpdatePeriod.name(), "0")
128+
.doesNotContainKey(ConfigConstants.header.name())
129+
.containsEntry(ConfigConstants.parallelPreprocessing.name(), "false")
130+
.containsEntry(ConfigConstants.connectionTimeout.name(), "2000")
131+
.containsEntry(ConfigConstants.encoding.name(), "UTF-8")
132+
.containsEntry(ConfigConstants.ignoreMissingResources.name(), "true")
133+
.containsEntry(ConfigConstants.ignoreEmptyGroup.name(), "true")
134+
.containsEntry(ConfigConstants.ignoreFailingProcessor.name(), "false")
135+
.containsEntry(ConfigConstants.cacheGzippedContent.name(), "true")
136+
.containsEntry(ConfigConstants.jmxEnabled.name(), "false")
137+
.doesNotContainKey(ConfigConstants.mbeanName.name());
138138

139139
wro4jProperties.setResourceWatcherUpdatePeriod(null);
140140
wro4jProperties.setCacheUpdatePeriod(null);
@@ -144,21 +144,21 @@ void wroFilterPropertiesShouldWork() {
144144
wro4jProperties.setEncoding("\t ");
145145
wro4jProperties.setMbeanName(" ");
146146
p = new Wro4jAutoConfiguration(this.applicationContext, Optional.empty()).wroFilterProperties(wro4jProperties);
147-
assertThat(p.get(ConfigConstants.resourceWatcherUpdatePeriod.name())).isNull();
148-
assertThat(p.get(ConfigConstants.cacheUpdatePeriod.name())).isNull();
149-
assertThat(p.get(ConfigConstants.modelUpdatePeriod.name())).isNull();
150-
assertThat(p.get(ConfigConstants.header.name())).isNull();
151-
assertThat(p.get(ConfigConstants.connectionTimeout.name())).isNull();
152-
assertThat(p.get(ConfigConstants.encoding.name())).isNull();
153-
assertThat(p.get(ConfigConstants.mbeanName.name())).isNull();
147+
assertThat(p).doesNotContainKey(ConfigConstants.resourceWatcherUpdatePeriod.name())
148+
.doesNotContainKey(ConfigConstants.cacheUpdatePeriod.name())
149+
.doesNotContainKey(ConfigConstants.modelUpdatePeriod.name())
150+
.doesNotContainKey(ConfigConstants.header.name())
151+
.doesNotContainKey(ConfigConstants.connectionTimeout.name())
152+
.doesNotContainKey(ConfigConstants.encoding.name())
153+
.doesNotContainKey(ConfigConstants.mbeanName.name());
154154

155155
wro4jProperties.setHeader("If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT");
156156
wro4jProperties.setEncoding("ISO-8859-1");
157157
wro4jProperties.setMbeanName("wro4j-bean");
158158
p = new Wro4jAutoConfiguration(this.applicationContext, Optional.empty()).wroFilterProperties(wro4jProperties);
159-
assertThat(p).containsEntry(ConfigConstants.header.name(), wro4jProperties.getHeader());
160-
assertThat(p).containsEntry(ConfigConstants.encoding.name(), wro4jProperties.getEncoding());
161-
assertThat(p).containsEntry(ConfigConstants.mbeanName.name(), wro4jProperties.getMbeanName());
159+
assertThat(p).containsEntry(ConfigConstants.header.name(), wro4jProperties.getHeader())
160+
.containsEntry(ConfigConstants.encoding.name(), wro4jProperties.getEncoding())
161+
.containsEntry(ConfigConstants.mbeanName.name(), wro4jProperties.getMbeanName());
162162

163163
wro4jProperties.setEncoding(null);
164164
p = new Wro4jAutoConfiguration(this.applicationContext, Optional.empty()).wroFilterProperties(wro4jProperties);

src/test/java/ac/simons/spring/boot/wro4j/Wro4jPropertiesTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ void defaultsShouldWork() {
3737
assertThat(properties.isDebug()).isTrue();
3838
assertThat(properties.isMinimizeEnabled()).isTrue();
3939
assertThat(properties.isGzipResources()).isTrue();
40-
assertThat(properties.getResourceWatcherUpdatePeriod()).isEqualTo(0);
40+
assertThat(properties.getResourceWatcherUpdatePeriod()).isZero();
4141
assertThat(properties.isResourceWatcherAsync()).isFalse();
42-
assertThat(properties.getCacheUpdatePeriod()).isEqualTo(0);
43-
assertThat(properties.getModelUpdatePeriod()).isEqualTo(0);
42+
assertThat(properties.getCacheUpdatePeriod()).isZero();
43+
assertThat(properties.getModelUpdatePeriod()).isZero();
4444
assertThat(properties.getHeader()).isNull();
4545
assertThat(properties.isParallelPreprocessing()).isFalse();
4646
assertThat(properties.getConnectionTimeout()).isEqualTo(2000L);

src/test/java/ac/simons/spring/boot/wro4j/processors/RemoveSourceMapsProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void processShouldWork() throws IOException {
5151
final StringWriter writer = new StringWriter();
5252
final RemoveSourceMapsProcessor processor = new RemoveSourceMapsProcessor();
5353
processor.process(null, reader, writer);
54-
assertThat(writer.toString()).isEqualTo("normal" + this.lineSeparator + " blanks am anfang und ende "
54+
assertThat(writer).hasToString("normal" + this.lineSeparator + " blanks am anfang und ende "
5555
+ this.lineSeparator + "Javascript Single line" + this.lineSeparator + "Javascript Multi line"
5656
+ this.lineSeparator + "CSS Multi line" + this.lineSeparator + "Depecrated formats" + this.lineSeparator
5757
+ "ende" + this.lineSeparator);

src/test/java/ac/simons/spring/boot/wro4j/processors/Wro4jProcessorProviderTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ void shouldProvideExpectedProcessors() {
3636

3737
final Map<String, ResourcePreProcessor> preProcessors = processorProvider.providePreProcessors();
3838
assertThat(preProcessors).isNotNull();
39-
assertThat(preProcessors.size()).isEqualTo(1);
40-
assertThat(preProcessors.containsKey("removeSourceMaps")).isTrue();
41-
assertThat(preProcessors.get("removeSourceMaps") instanceof RemoveSourceMapsProcessor).isTrue();
39+
assertThat(preProcessors).hasSize(1);
40+
assertThat(preProcessors).containsKey("removeSourceMaps");
41+
assertThat(preProcessors.get("removeSourceMaps")).isInstanceOf(RemoveSourceMapsProcessor.class);
4242
assertThat(processorProvider.providePostProcessors()).isEqualTo(new HashMap<String, ResourcePostProcessor>());
4343
}
4444

0 commit comments

Comments
 (0)