// Path: core-service/src/main/java/com/dataagg/CoreServiceApplication.java
// @SpringBootApplication
// @EnableResourceServer
// //@EnableDiscoveryClient
// @EnableOAuth2Client
// @EnableFeignClients
// @EnableGlobalMethodSecurity(prePostEnabled = true)
// @EnableConfigurationProperties
// @Configuration
// public class CoreServiceApplication extends ResourceServerConfigurerAdapter {
// 
// 	@Autowired
// 	private ResourceServerProperties sso;
// 
// 	public static void main(String[] args) {
// 		SpringApplication.run(CoreServiceApplication.class, args);
// 	}
// 
// 	@Bean
// 	@ConfigurationProperties(prefix = "security.oauth2.client")
// 	public ClientCredentialsResourceDetails clientCredentialsResourceDetails() {
// 		return new ClientCredentialsResourceDetails();
// 	}
// 
// 	@Bean
// 	public RequestInterceptor oauth2FeignRequestInterceptor() {
// 		return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), clientCredentialsResourceDetails());
// 	}
// 
// 	@Bean
// 	public OAuth2RestTemplate clientCredentialsRestTemplate() {
// 		return new OAuth2RestTemplate(clientCredentialsResourceDetails());
// 	}
// 
// 	@Bean
// 	public ResourceServerTokenServices tokenServices() {
// 		return new CustomUserInfoTokenServices(sso.getUserInfoUri(), sso.getClientId());
// 	}
// 
// 	@Override
// 	public void configure(HttpSecurity http) throws Exception {
// 		http.authorizeRequests().antMatchers("/", "/demo").permitAll().anyRequest().authenticated();
// 	}
// }
// 
// Path: commons/src/main/java/com/dataagg/commons/domain/ERole.java
// @Table("sys_role")
// @Comment("角色信息")
// public class ERole {
// 	@Id
// 	@Comment("主键")
// 	private Long id;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 64, notNull = true)
// 	@Comment("角色名")
// 	private String name;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 200, notNull = false)
// 	@Comment("描述")
// 	private String description;
// 
// 	@ManyMany(relation = "sys_role_authority", from = "role_id", to = "authority_id")
// 	private List<EAuthority> authorities = new ArrayList<>();
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<EAuthority> getAuthorities() {
// 		return authorities;
// 	}
// 
// 	public void setAuthorities(List<EAuthority> authorities) {
// 		this.authorities = authorities;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.dataagg.CoreServiceApplication;
import com.dataagg.commons.domain.ERole;
package com.dataagg.commons.dao;




@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = CoreServiceApplication.class)
public class RoleDaoTest {
	@Autowired
	private RoleDao roleDao;

	@Before
	public void setUp() throws Exception {}

	@After
	public void tearDown() throws Exception {}

	@Test
	public void testGetDefaultRoles() {}

	@Test
	public void testFetchByName() {}

	@Test
	public void testFetchFullByName() {}

	@Test
	public void testSave() {
// Path: core-service/src/main/java/com/dataagg/CoreServiceApplication.java
// @SpringBootApplication
// @EnableResourceServer
// //@EnableDiscoveryClient
// @EnableOAuth2Client
// @EnableFeignClients
// @EnableGlobalMethodSecurity(prePostEnabled = true)
// @EnableConfigurationProperties
// @Configuration
// public class CoreServiceApplication extends ResourceServerConfigurerAdapter {
// 
// 	@Autowired
// 	private ResourceServerProperties sso;
// 
// 	public static void main(String[] args) {
// 		SpringApplication.run(CoreServiceApplication.class, args);
// 	}
// 
// 	@Bean
// 	@ConfigurationProperties(prefix = "security.oauth2.client")
// 	public ClientCredentialsResourceDetails clientCredentialsResourceDetails() {
// 		return new ClientCredentialsResourceDetails();
// 	}
// 
// 	@Bean
// 	public RequestInterceptor oauth2FeignRequestInterceptor() {
// 		return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), clientCredentialsResourceDetails());
// 	}
// 
// 	@Bean
// 	public OAuth2RestTemplate clientCredentialsRestTemplate() {
// 		return new OAuth2RestTemplate(clientCredentialsResourceDetails());
// 	}
// 
// 	@Bean
// 	public ResourceServerTokenServices tokenServices() {
// 		return new CustomUserInfoTokenServices(sso.getUserInfoUri(), sso.getClientId());
// 	}
// 
// 	@Override
// 	public void configure(HttpSecurity http) throws Exception {
// 		http.authorizeRequests().antMatchers("/", "/demo").permitAll().anyRequest().authenticated();
// 	}
// }
// 
// Path: commons/src/main/java/com/dataagg/commons/domain/ERole.java
// @Table("sys_role")
// @Comment("角色信息")
// public class ERole {
// 	@Id
// 	@Comment("主键")
// 	private Long id;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 64, notNull = true)
// 	@Comment("角色名")
// 	private String name;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 200, notNull = false)
// 	@Comment("描述")
// 	private String description;
// 
// 	@ManyMany(relation = "sys_role_authority", from = "role_id", to = "authority_id")
// 	private List<EAuthority> authorities = new ArrayList<>();
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<EAuthority> getAuthorities() {
// 		return authorities;
// 	}
// 
// 	public void setAuthorities(List<EAuthority> authorities) {
// 		this.authorities = authorities;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// }


// Path: core-service/src/test/java/com/dataagg/commons/dao/RoleDaoTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.dataagg.CoreServiceApplication;
import com.dataagg.commons.domain.ERole;

package com.dataagg.commons.dao;




@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = CoreServiceApplication.class)
public class RoleDaoTest {
	@Autowired
	private RoleDao roleDao;

	@Before
	public void setUp() throws Exception {}

	@After
	public void tearDown() throws Exception {}

	@Test
	public void testGetDefaultRoles() {}

	@Test
	public void testFetchByName() {}

	@Test
	public void testFetchFullByName() {}

	@Test
	public void testSave() {
		ERole adminRole = new ERole();