use of com.cloudera.api.swagger.model.ApiHostRef in project knox by apache.
the class ClouderaManagerServiceDiscoveryTest method createMockApiRole.
private static ApiRole createMockApiRole(String name, String type, String hostname) {
ApiRole r = EasyMock.createNiceMock(ApiRole.class);
EasyMock.expect(r.getName()).andReturn(name).anyTimes();
EasyMock.expect(r.getType()).andReturn(type).anyTimes();
ApiHostRef hostRef = EasyMock.createNiceMock(ApiHostRef.class);
EasyMock.expect(hostRef.getHostname()).andReturn(hostname).anyTimes();
EasyMock.replay(hostRef);
EasyMock.expect(r.getHostRef()).andReturn(hostRef).anyTimes();
EasyMock.replay(r);
return r;
}
use of com.cloudera.api.swagger.model.ApiHostRef in project knox by apache.
the class AbstractCMDiscoveryTest method createApiRoleMock.
protected static ApiRole createApiRoleMock(final String roleName, final String roleType) {
ApiRole role = EasyMock.createNiceMock(ApiRole.class);
EasyMock.expect(role.getName()).andReturn(roleName).anyTimes();
EasyMock.expect(role.getType()).andReturn(roleType).anyTimes();
ApiHostRef hostRef = EasyMock.createNiceMock(ApiHostRef.class);
EasyMock.expect(hostRef.getHostname()).andReturn("localhost").anyTimes();
EasyMock.replay(hostRef);
EasyMock.expect(role.getHostRef()).andReturn(hostRef).anyTimes();
EasyMock.replay(role);
return role;
}
Aggregations