public static AWSCredentialsProvider deserialize(String awsCredentialsProviderSerialized) {
    ObjectMapper om = new ObjectMapper();
    om.registerModule(new AwsModule());
    try {
      return om.readValue(awsCredentialsProviderSerialized, AWSCredentialsProvider.class);
    } catch (IOException e) {
      throw new IllegalArgumentException(
          "AwsCredentialsProvider can not be deserialized from Json", e);
    }
  }
@Test(expected = IllegalArgumentException.class)
  public void testFailOnAWSCredentialsProviderDeserialization() {
    deserialize("invalid string");
  }