Clover icon

sunshower-base

  1. Project Clover database Fri Apr 6 2018 03:41:27 UTC
  2. Package io.sunshower.test.ws

File RESTBootstrapper.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
8
3
1
44
38
3
0.38
2.67
3
1

Classes

Class Line # Actions
RESTBootstrapper 9 8 3
1.0100%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.test.ws;
2   
3    import java.util.ArrayList;
4    import java.util.Arrays;
5    import java.util.List;
6    import org.springframework.test.context.*;
7    import org.springframework.test.context.support.DefaultTestContextBootstrapper;
8   
 
9    public class RESTBootstrapper extends DefaultTestContextBootstrapper
10    implements TestContextBootstrapper {
11   
 
12  1 toggle @Override
13    protected List<ContextCustomizerFactory> getContextCustomizerFactories() {
14  1 final List<ContextCustomizerFactory> customizerFactories =
15    new ArrayList<>(super.getContextCustomizerFactories());
16  1 customizerFactories.add(new RESTContextCustomizerFactory());
17  1 return customizerFactories;
18    }
19   
 
20  1 toggle @Override
21    protected MergedContextConfiguration processMergedContextConfiguration(
22    MergedContextConfiguration mergedConfig) {
23  1 final Class<?>[] classes = resolveClasses(mergedConfig);
24   
25  1 return new MergedContextConfiguration(
26    mergedConfig.getTestClass(),
27    mergedConfig.getLocations(),
28    classes,
29    mergedConfig.getContextInitializerClasses(),
30    mergedConfig.getActiveProfiles(),
31    mergedConfig.getPropertySourceLocations(),
32    mergedConfig.getPropertySourceProperties(),
33    mergedConfig.getContextCustomizers(),
34    mergedConfig.getContextLoader(),
35    getCacheAwareContextLoaderDelegate(),
36    mergedConfig.getParent());
37    }
38   
 
39  1 toggle private Class<?>[] resolveClasses(MergedContextConfiguration mergedConfig) {
40  1 List<Class<?>> results = new ArrayList<>(Arrays.asList(mergedConfig.getClasses()));
41  1 results.add(JAXRSConfiguration.class);
42  1 return results.toArray(new Class<?>[results.size()]);
43    }
44    }