Search in sources :

Example 1 with ApiHostRef

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;
}
Also used : ApiRole(com.cloudera.api.swagger.model.ApiRole) ApiHostRef(com.cloudera.api.swagger.model.ApiHostRef)

Example 2 with ApiHostRef

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;
}
Also used : ApiRole(com.cloudera.api.swagger.model.ApiRole) ApiHostRef(com.cloudera.api.swagger.model.ApiHostRef)

Aggregations

ApiHostRef (com.cloudera.api.swagger.model.ApiHostRef)2 ApiRole (com.cloudera.api.swagger.model.ApiRole)2