@Test
public void testWithInvalidBuildCommit() {

    // given
    Manifest manifest = mock(Manifest.class);
    Attributes attributes = mock(Attributes.class);
    when(manifest.getMainAttributes()).thenReturn(attributes);
    when(attributes.getValue("Implementation-Version")).thenReturn("0.1.2-SNAPSHOT");
    when(attributes.getValue("Build-Commit")).thenReturn("tooshort");
    when(attributes.getValue("Build-Time")).thenReturn("xyz");
    // when
    String version = Version.getVersion(manifest);
    // then
    assertThat(version).isEqualTo("0.1.2-SNAPSHOT, built xyz");
}