-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JUnit Test cases for Inventory API with Java Code Coverage 23% V1
- Loading branch information
AN20279976
authored and
AN20279976
committed
Mar 11, 2024
1 parent
923619a
commit 86b8d95
Showing
127 changed files
with
14,707 additions
and
531 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
66 changes: 66 additions & 0 deletions
66
src/main/java/com/iemr/inventory/config/InterceptorConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* AMRIT – Accessible Medical Records via Integrated Technology | ||
* Integrated EHR (Electronic Health Records) Solution | ||
* | ||
* Copyright (C) "Piramal Swasthya Management and Research Institute" | ||
* | ||
* This file is part of AMRIT. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/. | ||
*/ | ||
package com.iemr.inventory.config; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.stereotype.Repository; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
import com.iemr.inventory.utils.http.HTTPRequestInterceptor; | ||
|
||
//@Repository | ||
@Component | ||
@Configuration | ||
@EnableAutoConfiguration | ||
public class InterceptorConfig implements WebMvcConfigurer { | ||
|
||
@Autowired(required = false) | ||
private HTTPRequestInterceptor requestInterceptor; | ||
|
||
@Override | ||
public void addInterceptors(InterceptorRegistry registry) { | ||
registry.addInterceptor(new BlockingMethodInterceptor()).addPathPatterns("/**"); | ||
|
||
// Add your HTTPRequestInterceptor if available | ||
if (requestInterceptor != null) { | ||
registry.addInterceptor(requestInterceptor).addPathPatterns("/**"); | ||
} | ||
} | ||
} | ||
|
||
/* | ||
@Configuration | ||
public class InterceptorConfig implements WebMvcConfigurer { | ||
@Autowired(required=false) | ||
HTTPRequestInterceptor requestInterceptor; | ||
@Override | ||
public void addInterceptors(InterceptorRegistry registry) { | ||
registry.addInterceptor(new BlockingMethodInterceptor()) | ||
.addPathPatterns("/**"); | ||
} | ||
} */ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.