@Test
public void keepBuildSecurity() throws IOException {
// spy so that we can call real methods
BuildService buildService = spy(getInst());
// partial mocking, using doReturn to avoid type safety <?,?> BS
doReturn(build).when(buildService).getBuild(project, 1);
// test
buildService.keepBuild(project, 1, true);
// verify, security before operation
InOrder inOrder = inOrder(securityService, build);
inOrder.verify(securityService).checkPermission(build, Run.UPDATE);
inOrder.verify(build).keepLog(false);