This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Controller { | |
| @Value("${property}") private String property; | |
| public void property { | |
| System.out.println(property); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClassTest { | |
| private MyClass myClass = new MyClass(); | |
| @Test | |
| void testRightOrder() { | |
| assertEquals(5, myClass.add(2, 3)); // Error: expected: <5> but was: <6> | |
| } | |
| @Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyClass { | |
| public Integer add(Integer x, Integer y) { | |
| return x + y + 1; // Yes. Let's add 1 to fail the intent of this method. | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| httpClient.get('https://example.com/', { context: new HttpContext().set(BYPASS_LOG, true) }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const BYPASS_LOG = new HttpContextToken(() => false); | |
| export class MyLogInterceptor implements HttpInterceptor { | |
| intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | |
| if (req.context.get(BYPASS_LOG) === true) | |
| return next.handle(req); | |
| console.log(`req to ${req.url}`); | |
| return next.handle(req); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| angular | |
| .module('common') | |
| .directive('fileModel', fileModel); | |
| fileModel.$inject = ['$parse']; | |
| function fileModel($parse) { | |
| var directive = { | |
| restrict: 'A', | |
| link: link |