File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
src/test/java/com/sendgrid Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1
1
The MIT License (MIT)
2
2
3
- Copyright (c) 2013-2017 SendGrid
3
+ Copyright (c) 2013-2017 SendGrid, Inc.
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change
1
+ package com .sendgrid ;
2
+
3
+ import org .junit .Assert ;
4
+ import org .junit .Test ;
5
+
6
+ import java .io .BufferedReader ;
7
+ import java .io .FileReader ;
8
+ import java .io .IOException ;
9
+ import java .util .Calendar ;
10
+
11
+ public class LicenseTest {
12
+
13
+ @ Test
14
+ public void testLicenseShouldHaveCorrectYear () throws IOException {
15
+ String copyrightText = null ;
16
+ try (BufferedReader br = new BufferedReader (new FileReader ("./LICENSE.md" ))) {
17
+ for (String line ; (line = br .readLine ()) != null ; ) {
18
+ if (line .startsWith ("Copyright" )) {
19
+ copyrightText = line ;
20
+ break ;
21
+ }
22
+ }
23
+ }
24
+ String expectedCopyright = String .format ("Copyright (c) 2013-%d SendGrid, Inc." , Calendar .getInstance ().get (Calendar .YEAR ));
25
+ Assert .assertEquals ("License has incorrect year" , copyrightText , expectedCopyright );
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments