public Optional<ClassName> findTestee(final String className) { final TestToClassMapper mapper = new TestToClassMapper(this.classRepository); return mapper.findTestee(className); }
@Test public void shouldReturnNoneWhenNoTesteeExistsMatchingNamingConvention() { final byte[] bytes = null; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(Optional.empty(), this.testee.findTestee("com.example.TestFoo")); }
@Test public void shouldReturnNoneWhenNoTesteeExistsMatchingNamingConvention() { final byte[] bytes = null; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(Optional.empty(), this.testee.findTestee("com.example.TestFoo")); }
@Test public void shouldMapTestsPostfixedWithTestToTesteeWhenTesteeExists() { final byte[] bytes = { 0 }; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(ClassName.fromString("com.example.Foo"), this.testee.findTestee("com.example.FooTest").get()); }
@Test public void shouldMapTestsPrefixedWithTestToTesteeWhenTesteeExists() { final byte[] bytes = { 0 }; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(ClassName.fromString("com.example.Foo"), this.testee.findTestee("com.example.TestFoo").get()); }
@Test public void shouldMapTestsPrefixedWithTestToTesteeWhenTesteeExists() { final byte[] bytes = { 0 }; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(ClassName.fromString("com.example.Foo"), this.testee.findTestee("com.example.TestFoo").get()); }
@Test public void shouldMapTestsPostfixedWithTestToTesteeWhenTesteeExists() { final byte[] bytes = { 0 }; when(this.source.getBytes("com.example.Foo")) .thenReturn(Optional.ofNullable(bytes)); assertEquals(ClassName.fromString("com.example.Foo"), this.testee.findTestee("com.example.FooTest").get()); }
public Optional<ClassName> findTestee(final String className) { final TestToClassMapper mapper = new TestToClassMapper(this.classRepository); return mapper.findTestee(className); }