Cleanup, copyright, etc.

This commit is contained in:
Erik C. Thauvin 2020-03-23 13:17:18 -07:00
parent fd6c1309e3
commit c078a51ebf
26 changed files with 167 additions and 126 deletions

View file

@ -1,7 +1,7 @@
/*
* GoogleSearchTest.java
*
* Copyright (c) 2004-2019, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2004-2020, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -78,7 +78,7 @@ public class GoogleSearchTest extends LocalProperties {
assertThatThrownBy(() -> GoogleSearch.searchGoogle("", "apikey", "apiKey")).as("no query").isInstanceOf(
ModuleException.class).hasNoCause();
} catch (ModuleException e) {
// Avoid displaying api keys in CI logs.
// Avoid displaying api keys in CI logs
if ("true".equals(System.getenv("CI"))) {
throw new ModuleException(e.getDebugMessage(), e.getSanitizedMessage(apiKey, cseKey));
} else {

View file

@ -41,7 +41,7 @@ class RockPaperScissorsTest {
@Test(invocationCount = 5)
fun testWinLoseOrDraw() {
var play = RockPaperScissors.winLoseOrDraw(Shapes.SCISSORS)
// println("SCISSORS vs ${play.first}: ${play.second}")
// println("SCISSORS vs ${play.first}: ${playsecond}")
when (play.first) {
Shapes.SCISSORS -> assertThat(play.second).`as`("SCISSORS vs ${play.first}").isEqualTo(Results.DRAW)
Shapes.ROCK -> assertThat(play.second).`as`("SCISSORS vs ${play.first}").isEqualTo(Results.LOSE)
@ -49,7 +49,7 @@ class RockPaperScissorsTest {
}
play = RockPaperScissors.winLoseOrDraw(Shapes.ROCK)
// println("ROCK vs ${play.first}: ${play.second}")
// println("ROCK vs ${play.first}: ${playsecond}")
when (play.first) {
Shapes.SCISSORS -> assertThat(play.second).`as`("ROCK vs ${play.first}").isEqualTo(Results.WIN)
Shapes.ROCK -> assertThat(play.second).`as`("ROCK vs ${play.first}").isEqualTo(Results.DRAW)
@ -57,7 +57,7 @@ class RockPaperScissorsTest {
}
play = RockPaperScissors.winLoseOrDraw(Shapes.PAPER)
// println("PAPER vs ${play.first}: ${play.second}")
// println("PAPER vs ${play.first}: ${playsecond}")
when (play.first) {
Shapes.SCISSORS -> assertThat(play.second).`as`("PAPER vs ${play.first}").isEqualTo(Results.LOSE)
Shapes.ROCK -> assertThat(play.second).`as`("PAPER vs ${play.first}").isEqualTo(Results.WIN)

View file

@ -1,7 +1,7 @@
/*
* StockQuoteTest.java
*
* Copyright (c) 2004-2019, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2004-2020, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -73,7 +73,7 @@ public class StockQuoteTest extends LocalProperties {
ModuleException.class).hasNoCause();
} catch (ModuleException e) {
// Avoid displaying api keys in CI logs.
// Avoid displaying api keys in CI logs
if ("true".equals(System.getenv("CI"))) {
throw new ModuleException(e.getDebugMessage(), e.getSanitizedMessage(apiKey));
} else {