This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/turbine-core.git
The following commit(s) were added to refs/heads/trunk by this push: new bada538a Organize imports, address warnings bada538a is described below commit bada538aff69fd3b5339d8a75445b9f0ba68f4f2 Author: Thomas Vandahl <t...@apache.org> AuthorDate: Fri Jul 8 10:27:53 2022 +0200 Organize imports, address warnings --- .../turbine/annotation/AnnotatedMethodsTest.java | 42 ++++++++++------------ .../annotation/AnnotationProcessorTest.java | 31 +++++++++++----- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/test/org/apache/turbine/annotation/AnnotatedMethodsTest.java b/src/test/org/apache/turbine/annotation/AnnotatedMethodsTest.java index b75d79de..0b69762c 100644 --- a/src/test/org/apache/turbine/annotation/AnnotatedMethodsTest.java +++ b/src/test/org/apache/turbine/annotation/AnnotatedMethodsTest.java @@ -1,38 +1,34 @@ package org.apache.turbine.annotation; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.apache.commons.lang3.StringUtils; import org.apache.turbine.services.assemblerbroker.AssemblerBrokerService; -import org.apache.turbine.services.localization.DateTimeFormatterInterface; -import org.apache.turbine.services.localization.DateTimeFormatterService; import org.apache.turbine.services.pull.PullService; -import org.apache.turbine.services.pull.util.DateTimeFormatterTool; import org.apache.turbine.util.TurbineConfig; import org.apache.turbine.util.TurbineException; -import org.apache.velocity.context.Context; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestFactory; -import org.junit.jupiter.api.function.ThrowingConsumer; - -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoField; -import java.time.temporal.ChronoUnit; -import java.time.temporal.TemporalAccessor; -import java.util.function.Function; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; /** * Test class for AnnotatedMethodsTest to test method fields annotation diff --git a/src/test/org/apache/turbine/annotation/AnnotationProcessorTest.java b/src/test/org/apache/turbine/annotation/AnnotationProcessorTest.java index 5dedc7c6..2242c479 100644 --- a/src/test/org/apache/turbine/annotation/AnnotationProcessorTest.java +++ b/src/test/org/apache/turbine/annotation/AnnotationProcessorTest.java @@ -1,13 +1,29 @@ package org.apache.turbine.annotation; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; - /* - * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file @@ -24,7 +40,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * specific language governing permissions and limitations * under the License. */ - import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -39,8 +54,6 @@ import org.apache.turbine.annotation.AnnotationProcessor.ConditionType; import org.apache.turbine.modules.Screen; import org.apache.turbine.modules.ScreenLoader; import org.apache.turbine.services.assemblerbroker.AssemblerBrokerService; -import org.apache.turbine.services.localization.DateTimeFormatterService; -import org.apache.turbine.services.localization.DateTimeFormatterServiceTest; import org.apache.turbine.util.RunData; import org.apache.turbine.util.TurbineConfig; import org.apache.turbine.util.TurbineException; @@ -153,8 +166,8 @@ public class AnnotationProcessorTest Method[] methods = getClass().getMethods(); for (Method m : methods) { if (m.getName().equals( "guardedMethoded" )) { - assertTrue( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList)data.getACL(), ConditionType.ANY )); - assertFalse( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList)data.getACL(), ConditionType.COMPOUND )); + assertTrue( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList<?>)data.getACL(), ConditionType.ANY )); + assertFalse( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList<?>)data.getACL(), ConditionType.COMPOUND )); } } } @@ -178,7 +191,7 @@ public class AnnotationProcessorTest Method[] methods = getClass().getMethods(); for (Method m : methods) { if (m.getName().equals( "guardedMethodedAdmin" )) { - assertFalse( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList)data.getACL(), ConditionType.ANY )); + assertFalse( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList<?>)data.getACL(), ConditionType.ANY )); } } } @@ -202,7 +215,7 @@ public class AnnotationProcessorTest for (Method m : methods) { if (m.getName().equals( "unguardedMethoded" )) { // default is true, if not annotated - assertTrue( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList)data.getACL(), ConditionType.ANY )); + assertTrue( AnnotationProcessor.isAuthorized( m, (TurbineAccessControlList<?>)data.getACL(), ConditionType.ANY )); } } }