2 * ============LICENSE_START=======================================================
\r 
   4 * ================================================================================
\r 
   5 * Copyright 2019 China Mobile
\r 
   6 *=================================================================================
\r 
   7 * Licensed under the Apache License, Version 2.0 (the "License");
\r 
   8 * you may not use this file except in compliance with the License.
\r 
   9 * You may obtain a copy of the License at
\r 
  11 *     http://www.apache.org/licenses/LICENSE-2.0
\r 
  13 * Unless required by applicable law or agreed to in writing, software
\r 
  14 * distributed under the License is distributed on an "AS IS" BASIS,
\r 
  15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r 
  16 * See the License for the specific language governing permissions and
\r 
  17 * limitations under the License.
\r 
  18 * ============LICENSE_END=========================================================
\r 
  20 package org.onap.datalake.feeder.util;
\r 
  22 import static org.junit.Assert.assertEquals;
\r 
  23 import static org.junit.Assert.assertNotNull;
\r 
  25 import org.apache.velocity.VelocityContext;
\r 
  26 import org.junit.Test;
\r 
  27 import org.junit.runner.RunWith; 
\r 
  28 import org.onap.datalake.feeder.config.ApplicationConfiguration;
\r 
  29 import org.springframework.beans.factory.annotation.Autowired; 
\r 
  30 import org.springframework.boot.test.context.SpringBootTest; 
\r 
  31 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
\r 
  34  * Test DruidSupervisorGenerator
\r 
  35  * @author Guobiao Mo
\r 
  39 @RunWith(SpringJUnit4ClassRunner.class)
\r 
  40 @SpringBootTest(classes = ApplicationConfiguration.class)
\r 
  42 public class DruidSupervisorGeneratorTest {
\r 
  45         private ApplicationConfiguration config;
\r 
  48         public void testConstructor() {
\r 
  49                 DruidSupervisorGenerator gen = new DruidSupervisorGenerator();
\r 
  50                 VelocityContext context= gen.getContext();
\r 
  52                 assertNotNull(context);
\r 
  53                 assertNotNull(gen.getDimensions() );
\r 
  54                 assertNotNull(gen.getTemplate() );
\r 
  56                 String host = (String) context.get("host");             
\r 
  57                 assertEquals(host, config.getDmaapKafkaHostPort());                                             
\r