Package com.cloud.projects

Examples of com.cloud.projects.ProjectService


        };
    }

    @Test
    public void testGetEntityOwnerIdForNullProject() {
        ProjectService projectService = Mockito.mock(ProjectService.class);
        Mockito.when(projectService.getProject(Mockito.anyLong())).thenReturn(
                null);
        activateProjectCmd._projectService = projectService;

        try {
            activateProjectCmd.getEntityOwnerId();
View Full Code Here


    @Test
    public void testGetEntityOwnerIdForProject() {
        Project project = Mockito.mock(Project.class);
        Mockito.when(project.getId()).thenReturn(2L);
        ProjectService projectService = Mockito.mock(ProjectService.class);
        Account account = Mockito.mock(Account.class);
        Mockito.when(account.getId()).thenReturn(2L);
        Mockito.when(projectService.getProject(Mockito.anyLong())).thenReturn(
                project);

        Mockito.when(projectService.getProjectOwner(Mockito.anyLong()))
                .thenReturn(account);
        activateProjectCmd._projectService = projectService;

        Assert.assertEquals(2L, activateProjectCmd.getEntityOwnerId());
View Full Code Here

    public void testGetEntityOwnerIdForProject() {

        Project project = Mockito.mock(Project.class);
        Mockito.when(project.getId()).thenReturn(2L);

        ProjectService projectService = Mockito.mock(ProjectService.class);
        Account account = Mockito.mock(Account.class);

        Mockito.when(account.getId()).thenReturn(2L);
        Mockito.when(projectService.getProject(Mockito.anyLong())).thenReturn(
                project);

        Mockito.when(projectService.getProjectOwner(Mockito.anyLong()))
                .thenReturn(account);
        addAccountToProjectCmd._projectService = projectService;

        Assert.assertEquals(2L, addAccountToProjectCmd.getEntityOwnerId());
View Full Code Here

        };
    }

    @Test
    public void testGetEntityOwnerIdForNullProject() {
        ProjectService projectService = Mockito.mock(ProjectService.class);
        Mockito.when(projectService.getProject(Matchers.anyLong())).thenReturn(null);
        activateProjectCmd._projectService = projectService;

        try {
            activateProjectCmd.getEntityOwnerId();
        } catch (InvalidParameterValueException exception) {
View Full Code Here

    @Test
    public void testGetEntityOwnerIdForProject() {
        Project project = Mockito.mock(Project.class);
        Mockito.when(project.getId()).thenReturn(2L);
        ProjectService projectService = Mockito.mock(ProjectService.class);
        Account account = Mockito.mock(Account.class);
        Mockito.when(account.getId()).thenReturn(2L);
        Mockito.when(projectService.getProject(Matchers.anyLong())).thenReturn(project);

        Mockito.when(projectService.getProjectOwner(Matchers.anyLong())).thenReturn(account);
        activateProjectCmd._projectService = projectService;

        Assert.assertEquals(2L, activateProjectCmd.getEntityOwnerId());

    }
View Full Code Here

    public void testGetEntityOwnerIdForProject() {

        Project project = Mockito.mock(Project.class);
        Mockito.when(project.getId()).thenReturn(2L);

        ProjectService projectService = Mockito.mock(ProjectService.class);
        Account account = Mockito.mock(Account.class);

        Mockito.when(account.getId()).thenReturn(2L);
        Mockito.when(projectService.getProject(Matchers.anyLong())).thenReturn(project);

        Mockito.when(projectService.getProjectOwner(Matchers.anyLong())).thenReturn(account);
        addAccountToProjectCmd._projectService = projectService;

        Assert.assertEquals(2L, addAccountToProjectCmd.getEntityOwnerId());

    }
View Full Code Here

TOP

Related Classes of com.cloud.projects.ProjectService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.