summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorFlorian Zschocke <f.zschocke+git@gmail.com>2021-10-23 23:41:25 +0200
committerFlorian Zschocke <f.zschocke+git@gmail.com>2021-10-23 23:47:47 +0200
commitbb15bf10a7052adf0f5feb55db4f894a9053adac (patch)
tree95a3d24dd4501cf9d2852c24b7d560d8e4d66bff /src/test/java
parentb3f35278cead1c4647a10ae615258555618bd087 (diff)
downloadgitblit-bb15bf10a7052adf0f5feb55db4f894a9053adac.tar.gz
gitblit-bb15bf10a7052adf0f5feb55db4f894a9053adac.zip
TimeUtils: Move unit test to same package as TimeUtils is
For some reason the `TimeUtilsTest` class is, like almost all tests, in the `com.gitblit.tests` package. But this way all methods in classes which we might predominately need for tests have to be public. So move the unit test class `TimeUtilsTest` to the same package as the class it is testing, i.e. `com.gitblit.utils.TimeUtils`. This way we ca set the new added methods which get the current time passed in to be at least not public.
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/gitblit/tests/GitBlitSuite.java1
-rw-r--r--src/test/java/com/gitblit/utils/TimeUtilsTest.java (renamed from src/test/java/com/gitblit/tests/TimeUtilsTest.java)7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/java/com/gitblit/tests/GitBlitSuite.java b/src/test/java/com/gitblit/tests/GitBlitSuite.java
index 3292d090..fbae039c 100644
--- a/src/test/java/com/gitblit/tests/GitBlitSuite.java
+++ b/src/test/java/com/gitblit/tests/GitBlitSuite.java
@@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import com.gitblit.utils.TimeUtilsTest;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryCache;
diff --git a/src/test/java/com/gitblit/tests/TimeUtilsTest.java b/src/test/java/com/gitblit/utils/TimeUtilsTest.java
index 2dde6d51..77710e06 100644
--- a/src/test/java/com/gitblit/tests/TimeUtilsTest.java
+++ b/src/test/java/com/gitblit/utils/TimeUtilsTest.java
@@ -13,17 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.gitblit.tests;
+package com.gitblit.utils;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
+import com.gitblit.tests.GitblitUnitTest;
import org.junit.Test;
-import com.gitblit.utils.TimeUtils;
-public class TimeUtilsTest extends GitblitUnitTest {
+public class TimeUtilsTest extends GitblitUnitTest
+{
private Date offset(long subtract) {
return new Date(System.currentTimeMillis() - subtract);