-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute filterChain when starting integration tests (login possible v…
…ia basic auth - authorization header)
- Loading branch information
eschleb
committed
Dec 5, 2024
1 parent
6dcc754
commit f5d0d1f
Showing
12 changed files
with
240 additions
and
343 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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/merkle/oss/magnolia/testing/servlet/DeleteFilterTask.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,23 @@ | ||
package com.merkle.oss.magnolia.testing.servlet; | ||
|
||
import info.magnolia.module.InstallContext; | ||
import info.magnolia.module.delta.AbstractRepositoryTask; | ||
import info.magnolia.repository.RepositoryConstants; | ||
|
||
import javax.jcr.RepositoryException; | ||
import javax.jcr.Session; | ||
|
||
public class DeleteFilterTask extends AbstractRepositoryTask { | ||
private final String name; | ||
|
||
public DeleteFilterTask(final String name) { | ||
super("Delete" + name + "Filter", "Deletes " + name + " filter"); | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
protected void doExecute(final InstallContext installContext) throws RepositoryException { | ||
final Session session = installContext.getJCRSession(RepositoryConstants.CONFIG); | ||
session.removeItem("/server/filters/"+name); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/merkle/oss/magnolia/testing/servlet/MockFilterChain.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,10 @@ | ||
package com.merkle.oss.magnolia.testing.servlet; | ||
|
||
import javax.servlet.FilterChain; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
|
||
public class MockFilterChain implements FilterChain { | ||
@Override | ||
public void doFilter(final ServletRequest request, final ServletResponse response) {} | ||
} |
Oops, something went wrong.