本文整理汇总了Java中io.github.jhipster.config.JHipsterProperties.Ribbon方法的典型用法代码示例。如果您正苦于以下问题:Java JHipsterProperties.Ribbon方法的具体用法?Java JHipsterProperties.Ribbon怎么用?Java JHipsterProperties.Ribbon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.github.jhipster.config.JHipsterProperties
的用法示例。
在下文中一共展示了JHipsterProperties.Ribbon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import io.github.jhipster.config.JHipsterProperties; //导入方法依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
String mockProfile[] = {"test"};
JHipsterProperties.Ribbon ribbon = new JHipsterProperties.Ribbon();
ribbon.setDisplayOnActiveProfiles(mockProfile);
when(jHipsterProperties.getRibbon()).thenReturn(ribbon);
String activeProfiles[] = {"test"};
when(environment.getDefaultProfiles()).thenReturn(activeProfiles);
when(environment.getActiveProfiles()).thenReturn(activeProfiles);
ProfileInfoResource profileInfoResource = new ProfileInfoResource(environment, jHipsterProperties);
this.restProfileMockMvc = MockMvcBuilders
.standaloneSetup(profileInfoResource)
.build();
}
示例2: setup
import io.github.jhipster.config.JHipsterProperties; //导入方法依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
String mockProfile[] = { "test" };
JHipsterProperties.Ribbon ribbon = new JHipsterProperties.Ribbon();
ribbon.setDisplayOnActiveProfiles(mockProfile);
when(jHipsterProperties.getRibbon()).thenReturn(ribbon);
String activeProfiles[] = {"test"};
when(environment.getDefaultProfiles()).thenReturn(activeProfiles);
when(environment.getActiveProfiles()).thenReturn(activeProfiles);
ProfileInfoResource profileInfoResource = new ProfileInfoResource(environment, jHipsterProperties);
this.restProfileMockMvc = MockMvcBuilders
.standaloneSetup(profileInfoResource)
.build();
}
示例3: getProfileInfoWithoutRibbon
import io.github.jhipster.config.JHipsterProperties; //导入方法依赖的package包/类
@Test
public void getProfileInfoWithoutRibbon() throws Exception {
JHipsterProperties.Ribbon ribbon = new JHipsterProperties.Ribbon();
ribbon.setDisplayOnActiveProfiles(null);
when(jHipsterProperties.getRibbon()).thenReturn(ribbon);
restProfileMockMvc.perform(get("/api/profile-info"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE));
}
开发者ID:asanzdiego,项目名称:codemotion-2017-taller-de-jhipster,代码行数:11,代码来源:ProfileInfoResourceIntTest.java
示例4: setup
import io.github.jhipster.config.JHipsterProperties; //导入方法依赖的package包/类
@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);
}
示例5: getProfileInfoWithoutRibbon
import io.github.jhipster.config.JHipsterProperties; //导入方法依赖的package包/类
@Test
public void getProfileInfoWithoutRibbon() throws Exception {
JHipsterProperties.Ribbon ribbon = new JHipsterProperties.Ribbon();
ribbon.setDisplayOnActiveProfiles(null);
when(jHipsterProperties.getRibbon()).thenReturn(ribbon);
ProfileInfo profileInfo = stub.getActiveProfiles(Empty.newBuilder().build());
assertThat(profileInfo.getActiveProfilesList()).containsExactly("test");
assertThat(profileInfo.getRibbonEnv()).isEmpty();
}