forked from sendgrid/sendgrid-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLicenseTest.java
More file actions
28 lines (25 loc) · 847 Bytes
/
LicenseTest.java
File metadata and controls
28 lines (25 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.sendgrid;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Calendar;
import org.junit.Assert;
import org.junit.Test;
public class LicenseTest {
@Test
public void testLicenseShouldHaveCorrectYear() throws IOException {
String copyrightText = null;
try (BufferedReader br = new BufferedReader(new FileReader("./LICENSE"))) {
for (String line; (line = br.readLine()) != null; ) {
if (line.startsWith("Copyright")) {
copyrightText = line;
break;
}
}
}
String expectedCopyright = String
.format("Copyright (C) %d, Twilio SendGrid, Inc. <help@twilio.com>",
Calendar.getInstance().get(Calendar.YEAR));
Assert.assertEquals("License has incorrect year", copyrightText, expectedCopyright);
}
}