### Question:
LinkSettingsUtils { public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); }  static Map<String, Object> flattenSettings(Map<String, Object> settings); static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings); static Optional<IlpOverHttpLinkSettings.AuthType> getOutgoingAuthType(Map<String, Object> customSettings); static void validate(AuthenticatedLinkSettings linkSettings);  }### Answer:
@Test public void getIncomingAuthTypeWithSimple() { assertThat(LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsSimpleFlat())) .isEqualTo(Optional.of(IlpOverHttpLinkSettings.AuthType.SIMPLE)); assertThat(LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsSimpleHierarchical())) .isEqualTo(Optional.of(IlpOverHttpLinkSettings.AuthType.SIMPLE)); }
@Test public void getIncomingAuthTypeWithJwtHs256() { IlpOverHttpLinkSettings.AuthType authType = IlpOverHttpLinkSettings.AuthType.JWT_HS_256; assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtFlat(authType))) .isEqualTo(Optional.of(authType)); assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtHierarchical(authType))) .isEqualTo(Optional.of(authType)); }
@Test public void getIncomingAuthTypeWithJwtRs256() { IlpOverHttpLinkSettings.AuthType authType = IlpOverHttpLinkSettings.AuthType.JWT_RS_256; assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtFlat(authType))) .isEqualTo(Optional.of(authType)); assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtHierarchical(authType))) .isEqualTo(Optional.of(authType)); }