From ec2dabe9a160377a0b42da5cdef34674a2bd0fe9 Mon Sep 17 00:00:00 2001 From: "yang.zhang" <48794630+zhangyangx@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:58:49 +0800 Subject: [PATCH] Replace expiration method Signed-off-by: yang.zhang --- .../biz/repository/InstanceConfigRepositoryTest.java | 2 +- .../apollo/integration/ConfigIntegrationTest.java | 2 +- .../apollo/internals/DefaultConfigManagerTest.java | 2 +- .../apollo/spi/DefaultConfigFactoryManagerTest.java | 2 +- .../framework/apollo/spi/DefaultConfigFactoryTest.java | 2 +- .../framework/apollo/spi/DefaultConfigRegistryTest.java | 2 +- .../apollo/portal/controller/CommitControllerTest.java | 8 +++++--- .../portal/controller/ServerConfigControllerTest.java | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/InstanceConfigRepositoryTest.java b/apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/InstanceConfigRepositoryTest.java index 5b77df6eaba..7a6302bf188 100644 --- a/apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/InstanceConfigRepositoryTest.java +++ b/apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/InstanceConfigRepositoryTest.java @@ -27,7 +27,7 @@ import org.springframework.test.annotation.Rollback; import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; /** * Created by kezhenxu94 at 2019/1/18 15:33. diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/integration/ConfigIntegrationTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/integration/ConfigIntegrationTest.java index f09a17f319f..1f1d74b6259 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/integration/ConfigIntegrationTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/integration/ConfigIntegrationTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import com.ctrip.framework.apollo.util.OrderedProperties; diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigManagerTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigManagerTest.java index 66810167c96..fdc9bb41976 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigManagerTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigManagerTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import com.ctrip.framework.apollo.enums.ConfigSourceType; diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryManagerTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryManagerTest.java index b2db782ff2c..e72fcc6d41e 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryManagerTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryManagerTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import org.junit.After; import org.junit.Before; diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryTest.java index ca96cc16ee8..fb670fe5b7b 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryTest.java @@ -20,7 +20,7 @@ import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigRegistryTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigRegistryTest.java index 43ed933d27a..27d3ce62681 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigRegistryTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigRegistryTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import org.junit.Before; import org.junit.Test; diff --git a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/CommitControllerTest.java b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/CommitControllerTest.java index ac707409825..53cdb261cad 100644 --- a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/CommitControllerTest.java +++ b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/CommitControllerTest.java @@ -17,11 +17,13 @@ package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.AbstractIntegrationTest; -import java.util.List; import org.junit.Test; import org.springframework.web.client.HttpClientErrorException; + +import java.util.List; + +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.StringContains.containsString; -import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; /** @@ -40,7 +42,7 @@ public void shouldFailWhenPageOrSiseIsNegative() { ); fail("should throw"); } catch (final HttpClientErrorException e) { - assertThat( + assertThat( new String(e.getResponseBodyAsByteArray()), containsString("page should be positive or 0") ); } diff --git a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/ServerConfigControllerTest.java b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/ServerConfigControllerTest.java index 6db3ecbc441..3495d6d7b2b 100644 --- a/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/ServerConfigControllerTest.java +++ b/apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/controller/ServerConfigControllerTest.java @@ -25,7 +25,7 @@ import org.springframework.web.client.HttpClientErrorException; import static org.hamcrest.core.StringContains.containsString; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; /** * Created by kezhenxu at 2019/1/14 13:24.