spotbugs cleanups.

This commit is contained in:
Erik C. Thauvin 2019-04-20 05:20:42 -07:00
parent e5398d73ec
commit 7ff30c1ce8
16 changed files with 53 additions and 29 deletions

View file

@ -84,7 +84,7 @@ public class EntryLinkTest {
final List<SyndCategory> tags = entryLink.getTags();
int i = 0;
for (SyndCategory tag : tags) {
for (final SyndCategory tag : tags) {
assertThat(tag.getName()).as("tag.getName(" + i + ')').isEqualTo("tag" + (i + 1));
i++;
}

View file

@ -32,6 +32,8 @@
package net.thauvin.erik.mobibot.modules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import static org.assertj.core.api.Assertions.assertThat;
/**
@ -41,7 +43,9 @@ import static org.assertj.core.api.Assertions.assertThat;
* @created 2019-04-07
* @since 1.0
*/
final class AbstractModuleTest {
@SuppressFBWarnings("CE_CLASS_ENVY")
static void testAbstractModule(final AbstractModule module) {
final String name = module.getClass().getName();

View file

@ -32,6 +32,7 @@
package net.thauvin.erik.mobibot.modules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.thauvin.erik.mobibot.msg.Message;
import org.testng.annotations.Test;
@ -52,6 +53,7 @@ public class GoogleSearchTest extends LocalProperties {
AbstractModuleTest.testAbstractModule(new GoogleSearch());
}
@SuppressFBWarnings("LEST_LOST_EXCEPTION_STACK_TRACE")
@Test
public void testSearchGoogle() throws ModuleException {
final String apiKey = LocalProperties.getProperty(GoogleSearch.GOOGLE_API_KEY_PROP);

View file

@ -32,6 +32,7 @@
package net.thauvin.erik.mobibot.modules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.thauvin.erik.mobibot.msg.Message;
import org.testng.annotations.Test;
@ -46,7 +47,9 @@ import static org.assertj.core.api.Assertions.assertThat;
* @created 2019-04-07
* @since 1.0
*/
public class StockQuoteTest extends LocalProperties {
@SuppressFBWarnings("LEST_LOST_EXCEPTION_STACK_TRACE")
@Test
public void testGetQuote() throws ModuleException {
final String apiKey = LocalProperties.getProperty(StockQuote.ALPHAVANTAGE_API_KEY_PROP);

View file

@ -32,6 +32,7 @@
package net.thauvin.erik.mobibot.modules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.thauvin.erik.mobibot.Constants;
import org.testng.annotations.Test;
@ -48,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @since 1.0
*/
public class TwitterTest {
@SuppressFBWarnings("MDM")
private String getCi() {
if ("true".equals(System.getenv("CIRCLECI"))) {
return "CircleCI";

View file

@ -32,6 +32,7 @@
package net.thauvin.erik.mobibot.modules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.thauvin.erik.mobibot.msg.Message;
import org.testng.annotations.Test;
@ -47,6 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @since 1.0
*/
public class Weather2Test extends LocalProperties {
@SuppressFBWarnings("PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS")
@Test
public void testWeather() throws ModuleException {
ArrayList<Message> messages = Weather2.getWeather("98204",