Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With the upgrade of the gravitee-bom, some Mongo Repositories tests were failing. After a bit of investigation, all failing tests were missing indexes. I don't really understand what dependencies make this required...
- Loading branch information
1 parent
0a5fd3b
commit 48a3610
Showing
10 changed files
with
376 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
.../repository/mongodb/management/upgrade/upgrader/index/accesspoints/HostIndexUpgrader.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,37 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.accesspoints; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("AccessPointsHostIndexUpgrader") | ||
public class HostIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("access_points") | ||
.name("h1") | ||
.key("host", ascending()) | ||
.build(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...management/upgrade/upgrader/index/accesspoints/ReferenceIdReferenceTypeIndexUpgrader.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,38 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.accesspoints; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("AccessPointsReferenceIdReferenceTypeIndexUpgrader") | ||
public class ReferenceIdReferenceTypeIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("access_points") | ||
.name("rt_ri1") | ||
.key("referenceType", ascending()) | ||
.key("referenceId", ascending()) | ||
.build(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...ment/upgrade/upgrader/index/accesspoints/ReferenceIdReferenceTypeTargetIndexUpgrader.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,39 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.accesspoints; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("AccessPointsReferenceIdReferenceTypeTargetIndexUpgrader") | ||
public class ReferenceIdReferenceTypeTargetIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("access_points") | ||
.name("ri_rt_t1") | ||
.key("referenceId", ascending()) | ||
.key("referenceType", ascending()) | ||
.key("target", ascending()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...epository/mongodb/management/upgrade/upgrader/index/accesspoints/TargetIndexUpgrader.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,37 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.accesspoints; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("AccessPointsTargetIndexUpgrader") | ||
public class TargetIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("access_points") | ||
.name("t1") | ||
.key("target", ascending()) | ||
.build(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...b/management/upgrade/upgrader/index/licenses/IdReferenceIdReferenceTypeIndexUpgrader.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,38 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.licenses; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("LicensesIdReferenceIdReferenceTypeIndexUpgrader") | ||
public class IdReferenceIdReferenceTypeIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("licenses") | ||
.name("id_rt_ri1") | ||
.key("_id.referenceType", ascending()) | ||
.key("_id.referenceId", ascending()) | ||
.build(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...odb/management/upgrade/upgrader/index/licenses/ReferenceIdReferenceTypeIndexUpgrader.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,38 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.licenses; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("LicensesReferenceIdReferenceTypeIndexUpgrader") | ||
public class ReferenceIdReferenceTypeIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("licenses") | ||
.name("rt_ri1") | ||
.key("referenceType", ascending()) | ||
.key("referenceId", ascending()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...repository/mongodb/management/upgrade/upgrader/index/licenses/UpdatedAtIndexUpgrader.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,37 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.licenses; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("LicensesUpdatedAtIndexUpgrader") | ||
public class UpdatedAtIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("licenses") | ||
.name("f_t1") | ||
.key("updatedAt", ascending()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...itory/mongodb/management/upgrade/upgrader/index/organizations/CockpitIdIndexUpgrader.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,37 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.organizations; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("OrganizationsCockpitIdIndexUpgrader") | ||
public class CockpitIdIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("organizations") | ||
.name("cid1") | ||
.key("cockpitId", ascending()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...tee/repository/mongodb/management/upgrade/upgrader/index/pages/ParentIdIndexUpgrader.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,37 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.pages; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("PagesParentIdIndexUpgrader") | ||
public class ParentIdIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("pages") | ||
.name("pid1") | ||
.key("parentId", ascending()) | ||
.build(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...management/upgrade/upgrader/index/qualityrules/ReferenceIdReferenceTypeIndexUpgrader.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,38 @@ | ||
/* | ||
* Copyright © 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.mongodb.management.upgrade.upgrader.index.qualityrules; | ||
|
||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.Index; | ||
import io.gravitee.repository.mongodb.management.upgrade.upgrader.index.IndexUpgrader; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @author GraviteeSource Team | ||
*/ | ||
@Component("QualityRulesReferenceIdReferenceTypeIndexUpgrader") | ||
public class ReferenceIdReferenceTypeIndexUpgrader extends IndexUpgrader { | ||
|
||
@Override | ||
protected Index buildIndex() { | ||
return Index | ||
.builder() | ||
.collection("qualityrules") | ||
.name("ri1rt1") | ||
.key("referenceId", ascending()) | ||
.key("referenceType", ascending()) | ||
.build(); | ||
} | ||
} |