use of io.github.jhipster.config.JHipsterProperties in project jhipster-sample-app-elasticsearch by jhipster.
the class WebConfigurerTest method setup.
@Before
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class)).when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class)).when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
metricRegistry = new MetricRegistry();
webConfigurer.setMetricRegistry(metricRegistry);
}
use of io.github.jhipster.config.JHipsterProperties in project jhipster-sample-app-oauth2 by jhipster.
the class WebConfigurerTest method setup.
@Before
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class)).when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class)).when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
metricRegistry = new MetricRegistry();
webConfigurer.setMetricRegistry(metricRegistry);
}
use of io.github.jhipster.config.JHipsterProperties in project hello-world by haoziapple.
the class JWTFilterTest method setup.
@Before
public void setup() {
JHipsterProperties jHipsterProperties = new JHipsterProperties();
tokenProvider = new TokenProvider(jHipsterProperties);
ReflectionTestUtils.setField(tokenProvider, "secretKey", "test secret");
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000);
jwtFilter = new JWTFilter(tokenProvider);
SecurityContextHolder.getContext().setAuthentication(null);
}
use of io.github.jhipster.config.JHipsterProperties in project jhipster-registry by jhipster.
the class ProfileInfoResourceTest method setup.
@Before
public void setup() {
Environment env = Mockito.mock(Environment.class);
JHipsterProperties prop = Mockito.mock(JHipsterProperties.class);
JHipsterProperties.Ribbon ribbon = Mockito.mock(JHipsterProperties.Ribbon.class);
ProfileInfoResource profileInfoResource = new ProfileInfoResource(env, prop);
this.mock = MockMvcBuilders.standaloneSetup(profileInfoResource).build();
Mockito.when(env.getActiveProfiles()).thenReturn(profiles);
Mockito.when(prop.getRibbon()).thenReturn(ribbon);
}
use of io.github.jhipster.config.JHipsterProperties in project FuryViewer by TheDoctor-95.
the class WebConfigurerTest method setup.
@Before
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(new MockFilterRegistration()).when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(new MockServletRegistration()).when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
metricRegistry = new MetricRegistry();
webConfigurer.setMetricRegistry(metricRegistry);
}
Aggregations