From a62c1fda358f54bd3e7de9aea94ce63e89e06142 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 2 Oct 2020 17:53:34 +0300 Subject: Apply fixes from some IDEA code inspections --- src/test/java/com/juick/FormatterTest.java | 4 ++-- src/test/java/com/juick/config/TestActivityConfiguration.java | 2 +- src/test/java/com/juick/server/tests/ServerTests.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/com/juick/FormatterTest.java b/src/test/java/com/juick/FormatterTest.java index 1f805bb0..519d70a8 100644 --- a/src/test/java/com/juick/FormatterTest.java +++ b/src/test/java/com/juick/FormatterTest.java @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.*; public class FormatterTest { @Test - public void forAnyDateFormatterShouldReturnNotEmptyString() throws Exception { + public void forAnyDateFormatterShouldReturnNotEmptyString() { Instant ts = Instant.now(); assertThat(DateFormattersHolder.getMessageFormatterInstance().format(ts), not(emptyOrNullString())); @@ -49,7 +49,7 @@ public class FormatterTest { } @Test - public void forConcreteDateShouldReturnCorrectString() throws Exception { + public void forConcreteDateShouldReturnCorrectString() { Calendar calendar = GregorianCalendar.getInstance(); calendar.set(2012, 0, 1, 0, 0, 0); diff --git a/src/test/java/com/juick/config/TestActivityConfiguration.java b/src/test/java/com/juick/config/TestActivityConfiguration.java index 94b96bdf..854bad06 100644 --- a/src/test/java/com/juick/config/TestActivityConfiguration.java +++ b/src/test/java/com/juick/config/TestActivityConfiguration.java @@ -30,7 +30,7 @@ public class TestActivityConfiguration { @Value("classpath:test.p12") Resource keystoreFile; @Bean - public KeystoreManager testKeystoreManager() throws IOException { + public KeystoreManager testKeystoreManager() { return new KeystoreManager(keystoreFile, "secret"); } } diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 0bc23bf7..00259f8f 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -631,7 +631,7 @@ public class ServerTests { .andExpect(status().isOk()) .andReturn(); List tagsFromApi = jsonMapper.readValue(result.getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference<>() { }); TagStats yoStats = tagsFromApi.stream().filter(t -> t.getTag().getName().equals("yo")).findFirst().get(); assertThat(yoStats.getUsageCount(), is(2)); @@ -640,7 +640,7 @@ public class ServerTests { .andExpect(status().isOk()) .andReturn(); List ugnichTagsFromApi = jsonMapper.readValue(result2.getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference<>() { }); TagStats yoUgnichStats = ugnichTagsFromApi.stream().filter(t -> t.getTag().getName().equals("yo")).findFirst().get(); assertThat(yoUgnichStats.getUsageCount(), is(1)); @@ -690,7 +690,7 @@ public class ServerTests { .andExpect(status().isOk()) .andReturn(); List users = jsonMapper.readValue(result.getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference<>() { }); assertThat(users.size(), is(1)); assertThat(users.get(0).getTokens().size(), is(1)); @@ -1471,7 +1471,7 @@ public class ServerTests { } @Test - public void bannedUserShouldBeShadowedFromRecommendationsList() throws IOException { + public void bannedUserShouldBeShadowedFromRecommendationsList() { jdbcTemplate.execute("DELETE FROM bl_users"); User ermine = userService.createUser("ermine", "secret").orElseThrow(IllegalStateException::new); User monstreek = userService.createUser("monstreek", "secret").orElseThrow(IllegalStateException::new); -- cgit v1.2.3