diff --git a/LICENSE.md b/LICENSE.md index 84a49643..1e1037a5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2017 SendGrid +Copyright (c) 2013-2017 SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/sendgrid/LicenseTest.java b/src/test/java/com/sendgrid/LicenseTest.java new file mode 100644 index 00000000..1e06bf71 --- /dev/null +++ b/src/test/java/com/sendgrid/LicenseTest.java @@ -0,0 +1,27 @@ +package com.sendgrid; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.Calendar; + +public class LicenseTest { + + @Test + public void testLicenseShouldHaveCorrectYear() throws IOException { + String copyrightText = null; + try (BufferedReader br = new BufferedReader(new FileReader("./LICENSE.md"))) { + for (String line; (line = br.readLine()) != null; ) { + if (line.startsWith("Copyright")) { + copyrightText = line; + break; + } + } + } + String expectedCopyright = String.format("Copyright (c) 2013-%d SendGrid, Inc.", Calendar.getInstance().get(Calendar.YEAR)); + Assert.assertEquals("License has incorrect year", copyrightText, expectedCopyright); + } +}