Polish tests

This commit is contained in:
Moritz Halbritter
2023-08-08 09:46:15 +02:00
parent 4ea3c75331
commit 7bb337aeb1
21 changed files with 58 additions and 59 deletions

View File

@@ -48,7 +48,7 @@ class ChangeableUrlsTests {
@Test
void directoryUrl() throws Exception {
URL url = makeUrl("myproject");
assertThat(ChangeableUrls.fromUrls(url).size()).isOne();
assertThat(ChangeableUrls.fromUrls(url)).hasSize(1);
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,6 @@ import org.springframework.core.Ordered;
import org.springframework.test.util.ReflectionTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Mockito.mock;
/**
@@ -103,7 +102,7 @@ class RestartApplicationListenerTests {
SpringApplication application = new SpringApplication();
ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
listener.onApplicationEvent(new ApplicationStartingEvent(bootstrapContext, application, ARGS));
assertThat(Restarter.getInstance()).isNotEqualTo(nullValue());
assertThat(Restarter.getInstance()).isNotNull();
assertThat(Restarter.getInstance().isFinished()).isFalse();
listener.onApplicationEvent(new ApplicationPreparedEvent(application, ARGS, context));
if (failed) {