From 0d9f14e2f9d75eed4d1c39c8d92cc01a10842116 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 1 Dec 2021 15:58:19 +0200 Subject: [PATCH] Remove unnecessary class --- .../test/java/ro/pippo/core/EmptyHandler.java | 34 ------------------- .../ro/pippo/core/PathRegexBuilderTest.java | 2 +- .../pippo/core/route/DefaultRouterTest.java | 3 +- 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 pippo-core/src/test/java/ro/pippo/core/EmptyHandler.java diff --git a/pippo-core/src/test/java/ro/pippo/core/EmptyHandler.java b/pippo-core/src/test/java/ro/pippo/core/EmptyHandler.java deleted file mode 100644 index 15608215..00000000 --- a/pippo-core/src/test/java/ro/pippo/core/EmptyHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ro.pippo.core; - -import ro.pippo.core.route.RouteContext; -import ro.pippo.core.route.RouteHandler; - -/** - * An implementation of {@link RouteHandler} that do nothing. - * It's useful in tests. - * - * @author Decebal Suiu - */ -public class EmptyHandler implements RouteHandler { - - @Override - public void handle(RouteContext routeContext) { - // do nothing - } - -} diff --git a/pippo-core/src/test/java/ro/pippo/core/PathRegexBuilderTest.java b/pippo-core/src/test/java/ro/pippo/core/PathRegexBuilderTest.java index 568546bc..cdecb751 100644 --- a/pippo-core/src/test/java/ro/pippo/core/PathRegexBuilderTest.java +++ b/pippo-core/src/test/java/ro/pippo/core/PathRegexBuilderTest.java @@ -31,7 +31,7 @@ */ public class PathRegexBuilderTest { - private static final RouteHandler emptyHandler = new EmptyHandler(); + private static final RouteHandler emptyHandler = (routeContext) -> {}; private DefaultRouter router; diff --git a/pippo-core/src/test/java/ro/pippo/core/route/DefaultRouterTest.java b/pippo-core/src/test/java/ro/pippo/core/route/DefaultRouterTest.java index 3df9613c..529ea61b 100644 --- a/pippo-core/src/test/java/ro/pippo/core/route/DefaultRouterTest.java +++ b/pippo-core/src/test/java/ro/pippo/core/route/DefaultRouterTest.java @@ -20,7 +20,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import ro.pippo.core.EmptyHandler; import ro.pippo.core.HttpConstants; import java.util.Collections; @@ -36,7 +35,7 @@ */ public class DefaultRouterTest { - private static final RouteHandler emptyHandler = new EmptyHandler(); + private static final RouteHandler emptyHandler = routeContext -> {}; private DefaultRouter router;