DefaultInterfaceConfigBuilderFactory implements InterfaceConfigBuilderFactory { public InterfaceConfigBuilder newInstance(Class<?> interfaze) { return new DefaultInterfaceConfigBuilder(interfaze, crestConfig, mimeDeserializerRegistry, classSerializerRegistry); } DefaultInterfaceConfigBuilderFactory(CRestConfig crestConfig, ComponentRegistry<String, Deserializer> mimeDeserializerRegistry, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry); InterfaceConfigBuilder newInstance(Class<?> interfaze);  }
@Test public void shouldBuildAnInstanceOfDefaultInterfaceConfigBuilderWithGivenParams() throws Exception { DefaultInterfaceConfigBuilder expected = mock(DefaultInterfaceConfigBuilder.class); whenNew(DefaultInterfaceConfigBuilder.class) .withArguments(TestInterface.class, mockCrestConfig, mockMimeDeserializerRegistry, mockClassSerializerRegistry) .thenReturn(expected); InterfaceConfigBuilder actual = toTest.newInstance(TestInterface.class); assertSame(expected, actual); }