### Question:
ConfigurableApiFileNameChecker implements ApiFileNameChecker { @Override public boolean isApiFile(String fileName) { return fileName.endsWith(apiFilename) || fileName.endsWith(apiFilename + ".yaml") || fileName.endsWith(apiFilename + ".yml") || fileName.endsWith(apiFilename + ".json"); } ConfigurableApiFileNameChecker(String apiFilename); @Override boolean isApiFile(String fileName); @Override int getOrder();  }### Answer:
@Test public void testIsApiShouldReturnFalseWhenDoesntMatch() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi"); boolean result = underTest.isApiFile("c:/api/swagger.yaml"); assertThat(result).isFalse(); }
@Test public void testIsApiShouldReturnTrueWhenYamlMatchesFullPath() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi"); boolean result = underTest.isApiFile("c:/api/openapi.yaml"); assertThat(result).isTrue(); }
@Test public void testIsApiShouldReturnTrueWhenYamlMatches() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi"); boolean result = underTest.isApiFile("openapi.yaml"); assertThat(result).isTrue(); }
@Test public void testIsApiShouldReturnTrueWhenYmlMatches() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi"); boolean result = underTest.isApiFile("openapi.yml"); assertThat(result).isTrue(); }
@Test public void testIsApiShouldReturnTrueWhenJsonMatches() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi"); boolean result = underTest.isApiFile("openapi.json"); assertThat(result).isTrue(); }
@Test public void testIsApiShouldReturnTrueWhenExtensionIsProvidedAndMatches() { ConfigurableApiFileNameChecker underTest = new ConfigurableApiFileNameChecker("openapi.txt"); boolean result = underTest.isApiFile("openapi.txt"); assertThat(result).isTrue(); }