diff options
author | kaihlavi <l.kaihlavirt@partner.samsung.com> | 2019-02-14 12:08:36 +0200 |
---|---|---|
committer | kaihlavi <l.kaihlavirt@partner.samsung.com> | 2019-02-14 16:04:19 +0200 |
commit | a1a71e8e4a02976839f4a1fb9f0c9813d60b9a0b (patch) | |
tree | 7b82aa5cdfc2a5f3675a2cb6334b5ec72fda8ddc /ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf | |
parent | 939cf950022f89aec547d3a6a9f6b9443b7a8a95 (diff) |
Reformat ONAP-SDK-APP test cases
Reformat test cases to follow ONAP style
https://wiki.onap.org/display/DW/Java+code+style
Format changes mainly consist of conversions of tabs to 4 spaces
Samsung modifications copyrights added
Issue-ID: POLICY-1506
Change-Id: I71ddf1137f4ab6b84474e85b6c521daf07c9beee
Signed-off-by: kaihlavi <l.kaihlavirt@partner.samsung.com>
Diffstat (limited to 'ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf')
3 files changed, 66 insertions, 63 deletions
diff --git a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java index 133d4a860..fb11e246c 100644 --- a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java +++ b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java @@ -1,15 +1,17 @@ /*- * ============LICENSE_START======================================================= - * ONAP Policy Engine + * ONAP Portal SDK * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (C) 2019 Samsung + * ================================================================================ * 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. @@ -36,37 +38,36 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; public class ExternalAppConfigTest { - @Test - public void testConfig() throws MalformedURLException { - // Setup test data - ApplicationContext ctx = Mockito.mock(ApplicationContext.class); - UrlResource value = new UrlResource("http://localhost"); - Mockito.when(ctx.getResource(Mockito.any())).thenReturn(value); - ResourceHandlerRegistry registry = new ResourceHandlerRegistry(ctx, null); - InterceptorRegistry interceptor = new InterceptorRegistry(); - RegistryAdapter schedulerRegistryAdapter = new RegistryAdapter(); - Registerable reg = Mockito.mock(Registerable.class); - Mockito.when(reg.getTriggers()).thenReturn(new Trigger[1]); - schedulerRegistryAdapter.setRegistry(reg); - WorkflowScheduleService workflowScheduleService = Mockito.mock(WorkflowScheduleService.class); - schedulerRegistryAdapter.setWorkflowScheduleService(workflowScheduleService); - Mockito.when(workflowScheduleService.triggerWorkflowScheduling()) - .thenReturn(Collections.emptyList()); + @Test + public void testConfig() throws MalformedURLException { + // Setup test data + ApplicationContext ctx = Mockito.mock(ApplicationContext.class); + UrlResource value = new UrlResource("http://localhost"); + Mockito.when(ctx.getResource(Mockito.any())).thenReturn(value); + ResourceHandlerRegistry registry = new ResourceHandlerRegistry(ctx, null); + InterceptorRegistry interceptor = new InterceptorRegistry(); + RegistryAdapter schedulerRegistryAdapter = new RegistryAdapter(); + Registerable reg = Mockito.mock(Registerable.class); + Mockito.when(reg.getTriggers()).thenReturn(new Trigger[1]); + schedulerRegistryAdapter.setRegistry(reg); + WorkflowScheduleService workflowScheduleService = Mockito.mock(WorkflowScheduleService.class); + schedulerRegistryAdapter.setWorkflowScheduleService(workflowScheduleService); + Mockito.when(workflowScheduleService.triggerWorkflowScheduling()).thenReturn(Collections.emptyList()); - // Test constructor - ExternalAppConfig config = new ExternalAppConfig(); - assertNotNull(config); + // Test constructor + ExternalAppConfig config = new ExternalAppConfig(); + assertNotNull(config); - // Test set and get - config.setApplicationContext(ctx); - assertNotNull(config.viewResolver()); - config.addResourceHandlers(registry); - assertNotNull(config.dataAccessService()); - assertNotNull(config.addTileDefinitions()); - config.addInterceptors(interceptor); - assertNotNull(config.cacheManager()); - config.setSchedulerRegistryAdapter(schedulerRegistryAdapter); - assertNull(config.schedulerFactoryBean()); - assertNotNull(config.loginStrategy()); - } + // Test set and get + config.setApplicationContext(ctx); + assertNotNull(config.viewResolver()); + config.addResourceHandlers(registry); + assertNotNull(config.dataAccessService()); + assertNotNull(config.addTileDefinitions()); + config.addInterceptors(interceptor); + assertNotNull(config.cacheManager()); + config.setSchedulerRegistryAdapter(schedulerRegistryAdapter); + assertNull(config.schedulerFactoryBean()); + assertNotNull(config.loginStrategy()); + } } diff --git a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppInitializerTest.java b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppInitializerTest.java index 81bf7e95a..7a2ab1654 100644 --- a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppInitializerTest.java +++ b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/ExternalAppInitializerTest.java @@ -4,12 +4,14 @@ * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property * ================================================================================ + * Modifications Copyright (C) 2019 Samsung + * ================================================================================ * 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. @@ -20,26 +22,25 @@ package org.onap.portalapp.conf; import static org.junit.Assert.assertTrue; - import org.junit.Test; public class ExternalAppInitializerTest { - @Test - public void testExternalAppInitializer(){ - ExternalAppInitializer initializer = new ExternalAppInitializer(); - assertTrue(initializer.getRootConfigClasses()!=null); - assertTrue(initializer.getServletConfigClasses()!=null); - assertTrue(initializer.getServletMappings()!=null); - } - - @Test - public void testExternalAppConfig(){ - ExternalAppConfig appConfig = new ExternalAppConfig(); - assertTrue(appConfig.dataAccessService()!=null); - assertTrue(appConfig.addTileDefinitions()!=null); - assertTrue(appConfig.cacheManager()!=null); - assertTrue(appConfig.loginStrategy()!=null); - assertTrue(appConfig.viewResolver()!=null); - } + @Test + public void testExternalAppInitializer() { + ExternalAppInitializer initializer = new ExternalAppInitializer(); + assertTrue(initializer.getRootConfigClasses() != null); + assertTrue(initializer.getServletConfigClasses() != null); + assertTrue(initializer.getServletMappings() != null); + } + + @Test + public void testExternalAppConfig() { + ExternalAppConfig appConfig = new ExternalAppConfig(); + assertTrue(appConfig.dataAccessService() != null); + assertTrue(appConfig.addTileDefinitions() != null); + assertTrue(appConfig.cacheManager() != null); + assertTrue(appConfig.loginStrategy() != null); + assertTrue(appConfig.viewResolver() != null); + } } diff --git a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/HibernateMappingLocationsTest.java b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/HibernateMappingLocationsTest.java index 6762e4aee..25d878e8c 100644 --- a/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/HibernateMappingLocationsTest.java +++ b/ONAP-SDK-APP/src/test/java/org/onap/portalapp/conf/HibernateMappingLocationsTest.java @@ -4,12 +4,14 @@ * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property * ================================================================================ + * Modifications Copyright (C) 2019 Samsung + * ================================================================================ * 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. @@ -20,15 +22,14 @@ package org.onap.portalapp.conf; import static org.junit.Assert.assertTrue; - import org.junit.Test; public class HibernateMappingLocationsTest { - @Test - public void testHibernateMappingLocations(){ - HibernateMappingLocations locations = new HibernateMappingLocations(); - assertTrue(locations.getMappingLocations()!=null); - assertTrue(locations.getPackagesToScan()!=null); - } + @Test + public void testHibernateMappingLocations() { + HibernateMappingLocations locations = new HibernateMappingLocations(); + assertTrue(locations.getMappingLocations() != null); + assertTrue(locations.getPackagesToScan() != null); + } } |