Skip to content

Instantly share code, notes, and snippets.

@edipofederle
Created March 18, 2013 13:48
Show Gist options
  • Select an option

  • Save edipofederle/5187254 to your computer and use it in GitHub Desktop.

Select an option

Save edipofederle/5187254 to your computer and use it in GitHub Desktop.
Architecture a = mock(Architecture.class);
when(a.getName()).thenReturn("arch");
Class class1 = mock(Class.class);
when(class1.getName()).thenReturn("Class1");
List<Class> klasses = new ArrayList<Class>();
klasses.add(class1);
when(a.getClasses()).thenReturn(klasses);
System.out.println(a.findClassByName("f"); // FindClassByName chama getClasses(), nao deveria retornar klasses?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment