@Test public void testGetCommiters() { List<Culprit> users = new ArrayList<Culprit>(); Culprit user1 = new Culprit(); Culprit user2 = new Culprit(); user1.setFullName("dude"); user2.setFullName("sweet"); users.add(user1); users.add(user2); MavenModuleSetBuild setBuild = mock(MavenModuleSetBuild.class); when(setBuild.getCulprits()).thenReturn(users); String[] commiters = HudsonXmlHelper.getCommiterNames(setBuild); assertEquals("dude", commiters[0]); assertEquals("sweet", commiters[1]); }
public static String[] getCommiterNames(Build build) { checkBuild(build); List<Culprit> users = build.getCulprits(); String[] commiters = new String[users.size()]; for (int i = 0; i < users.size(); i++) { Culprit hudsonModelUser = users.get(i); String name = hudsonModelUser.getFullName(); commiters[i] = name; } return commiters; }
HudsonXmlHelper { public static String[] getCommiterNames(Build build) { checkBuild(build); List<Culprit> users = build.getCulprits(); String[] commiters = new String[users.size()]; for (int i = 0; i < users.size(); i++) { Culprit hudsonModelUser = users.get(i); String name = hudsonModelUser.getFullName(); commiters[i] = name; } return commiters; } }
HudsonXmlHelper { public static String[] getCommiterNames(Build build) { checkBuild(build); List<Culprit> users = build.getCulprits(); String[] commiters = new String[users.size()]; for (int i = 0; i < users.size(); i++) { Culprit hudsonModelUser = users.get(i); String name = hudsonModelUser.getFullName(); commiters[i] = name; } return commiters; } private  HudsonXmlHelper(); }
HudsonXmlHelper { public static String[] getCommiterNames(Build build) { checkBuild(build); List<Culprit> users = build.getCulprits(); String[] commiters = new String[users.size()]; for (int i = 0; i < users.size(); i++) { Culprit hudsonModelUser = users.get(i); String name = hudsonModelUser.getFullName(); commiters[i] = name; } return commiters; } private  HudsonXmlHelper(); static boolean isSuccessful(Build build); static String[] getCommiterNames(Build build); }
HudsonXmlHelper { public static String[] getCommiterNames(Build build) { checkBuild(build); List<Culprit> users = build.getCulprits(); String[] commiters = new String[users.size()]; for (int i = 0; i < users.size(); i++) { Culprit hudsonModelUser = users.get(i); String name = hudsonModelUser.getFullName(); commiters[i] = name; } return commiters; } private  HudsonXmlHelper(); static boolean isSuccessful(Build build); static String[] getCommiterNames(Build build);  }