From c8e62ea9afac77440481d3baf2e1cb67e46375d0 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sat, 4 Jul 2020 15:44:23 +0800 Subject: [PATCH] Remove spring boot from auth tests --- .../java/feast/core/auth/AuthConfigTest.java | 42 ------------------- .../java/feast/core/auth/AuthTestConfig.java | 40 ------------------ .../feast/core/grpc/CoreServiceAuthTest.java | 2 - 3 files changed, 84 deletions(-) delete mode 100644 core/src/test/java/feast/core/auth/AuthConfigTest.java delete mode 100644 core/src/test/java/feast/core/auth/AuthTestConfig.java diff --git a/core/src/test/java/feast/core/auth/AuthConfigTest.java b/core/src/test/java/feast/core/auth/AuthConfigTest.java deleted file mode 100644 index dd5a1e3a760..00000000000 --- a/core/src/test/java/feast/core/auth/AuthConfigTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * Copyright 2018-2020 The Feast 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 - * - * https://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 feast.core.auth; - -import static org.junit.Assert.assertNotNull; - -import feast.auth.config.SecurityConfig; -import javax.inject.Inject; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -@ExtendWith(SpringExtension.class) -@SpringBootTest(classes = {AuthTestConfig.class, SecurityConfig.class}) -@TestPropertySource(locations = {"classpath:application.properties", "classpath:application.yml"}) -class AuthConfigTest { - - @Inject AuthenticationManager authManager; - @Inject AuthTestConfig config; - - @Test - void canConfigureAuth() { - assertNotNull(authManager); - } -} diff --git a/core/src/test/java/feast/core/auth/AuthTestConfig.java b/core/src/test/java/feast/core/auth/AuthTestConfig.java deleted file mode 100644 index 50f29499fcf..00000000000 --- a/core/src/test/java/feast/core/auth/AuthTestConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * Copyright 2018-2019 The Feast 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 - * - * https://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 feast.core.auth; - -import feast.core.config.FeastProperties; -import java.util.Properties; -import javax.inject.Inject; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.info.BuildProperties; -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.context.annotation.Bean; - -/** Configuration of JPA related services and beans for the core application. */ -@TestConfiguration -@EnableConfigurationProperties(FeastProperties.class) -public class AuthTestConfig { - - public @Inject FeastProperties feast; - - @Bean - public BuildProperties buildProperties() { - Properties props = new Properties(); - props.put("version", "test"); - return new BuildProperties(props); - } -} diff --git a/core/src/test/java/feast/core/grpc/CoreServiceAuthTest.java b/core/src/test/java/feast/core/grpc/CoreServiceAuthTest.java index e7619b1d6a4..5da7b1f566d 100644 --- a/core/src/test/java/feast/core/grpc/CoreServiceAuthTest.java +++ b/core/src/test/java/feast/core/grpc/CoreServiceAuthTest.java @@ -53,13 +53,11 @@ import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; -@SpringBootTest class CoreServiceAuthTest { private CoreServiceImpl coreService;